storage.memory
Class BareContent

java.lang.Object
  extended byorg.nodal.util.NodeFilter
      extended bystorage.memory.BareContent
All Implemented Interfaces:
Content, Node, NodeContent, TxnMonitorable
Direct Known Subclasses:
BareMap, BareRecord, BareSequence

public abstract class BareContent
extends NodeFilter
implements NodeContent


Nested Class Summary
static class BareContent.Editor
           
 
Field Summary
protected  storage.memory.MemContentI c
           
protected  Capability cap
           
protected  storage.framework.RepoServices services
           
protected  java.util.List txnHandlers
           
 
Fields inherited from class org.nodal.util.NodeFilter
node
 
Constructor Summary
protected BareContent(Node n, memContent c, Capability cap, storage.framework.RepoServices nodeFactory)
           
 
Method Summary
 void addTxnHandler(TxnHandler handler)
          Add a TxnHandler to be invoked when this object changes.
 AnchorNode asAnchor()
          An AnchorNode interface if this Node is an anchor, otherwise null.
 MapNode asMapNode()
          The Node's contents expressed as a Map.
 RecordNode asRecordNode()
          The Node's contents expressed as a Record.
 SequenceNode asSequenceNode()
          The Node's contents expressed as a Sequence.
 Capability capability()
          A Capability describing the User's current permissions for this Node.
 NodeContent content()
          The Node's contents.
abstract  NodeContent.Editor edit()
          An Editor for changing the Content of this Node.
 java.lang.Object getValue(java.lang.Object idx)
          Access the property value, given a property.
 Operator invert(Operator op)
          Produce an Operator that would undo the application of op on this Content.
protected  void notifyInsertAfter(int index, java.lang.Object value)
           
protected  void notifyInsertBefore(int index, java.lang.Object value)
           
protected  void notifyRemoveKey(java.lang.Object key)
           
protected  void notifyRemoveRange(int start, int end)
           
protected  void notifyReplaceRange(int start, int end, java.lang.Object seq)
           
protected  void notifySetValue(java.lang.Object property, java.lang.Object value)
           
 java.util.Iterator properties()
          A sequence of all of the properties currently indexing the contents if this Content.
 void removeTxnHandler(TxnHandler handler)
          Remove a previously added TxnHandler.
 int size()
          The number of properties contained in this Content object.
 Getter value(java.lang.Object obj)
          A generic Getter for property values, given a property.
 
Methods inherited from class org.nodal.util.NodeFilter
bareNode, editMap, editRecord, editSequence, history, id, path, repository, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nodal.model.Node
bareNode, editMap, editRecord, editSequence, history, id, path, repository, type
 
Methods inherited from interface org.nodal.model.Content
isValidProperty, type
 

Field Detail

cap

protected final Capability cap

c

protected final storage.memory.MemContentI c

services

protected final storage.framework.RepoServices services

txnHandlers

protected java.util.List txnHandlers
Constructor Detail

BareContent

protected BareContent(Node n,
                      memContent c,
                      Capability cap,
                      storage.framework.RepoServices nodeFactory)
Method Detail

capability

public Capability capability()
Description copied from interface: Node
A Capability describing the User's current permissions for this Node.

Specified by:
capability in interface Node
Overrides:
capability in class NodeFilter

content

public NodeContent content()
Description copied from interface: Node
The Node's contents.

If the Capability does not provide read access, then this will return null.

Specified by:
content in interface Node
Overrides:
content in class NodeFilter

asAnchor

public AnchorNode asAnchor()
Description copied from interface: Node
An AnchorNode interface if this Node is an anchor, otherwise null.

Specified by:
asAnchor in interface Node
Overrides:
asAnchor in class NodeFilter

addTxnHandler

public void addTxnHandler(TxnHandler handler)
Description copied from interface: TxnMonitorable
Add a TxnHandler to be invoked when this object changes.

Specified by:
addTxnHandler in interface TxnMonitorable
Parameters:
handler - a TxnHandler whose notify methods will be invoked when this object changes.

removeTxnHandler

public void removeTxnHandler(TxnHandler handler)
Description copied from interface: TxnMonitorable
Remove a previously added TxnHandler.

Specified by:
removeTxnHandler in interface TxnMonitorable
Parameters:
handler - a TxnHandler that has previously been added.

notifyInsertAfter

protected void notifyInsertAfter(int index,
                                 java.lang.Object value)

notifyInsertBefore

protected void notifyInsertBefore(int index,
                                  java.lang.Object value)

notifyRemoveKey

protected void notifyRemoveKey(java.lang.Object key)

notifyRemoveRange

protected void notifyRemoveRange(int start,
                                 int end)

notifyReplaceRange

protected void notifyReplaceRange(int start,
                                  int end,
                                  java.lang.Object seq)

notifySetValue

protected void notifySetValue(java.lang.Object property,
                              java.lang.Object value)

size

public int size()
Description copied from interface: Content
The number of properties contained in this Content object.

Specified by:
size in interface Content

properties

public java.util.Iterator properties()
Description copied from interface: Content
A sequence of all of the properties currently indexing the contents if this Content.

Specified by:
properties in interface Content

value

public Getter value(java.lang.Object obj)
             throws PropertyConstraintFailure
Description copied from interface: Content
A generic Getter for property values, given a property.

Will throw an exception if the property type is invalid, but not if the property is not available in this Node's content. This way, a value Getter can be established in anticipation of the addition of a property.

Specified by:
value in interface Content
Parameters:
obj - the Object that identifies this property
Throws:
PropertyConstraintFailure

getValue

public final java.lang.Object getValue(java.lang.Object idx)
                                throws PropertyConstraintFailure
Description copied from interface: Content
Access the property value, given a property.

Will throw an exception if the property type is invalid, but not if the property is not available in this Node's content. This way, a value Getter can be established in anticipation of the addition of a property.

Specified by:
getValue in interface Content
Parameters:
idx - the Object that identifies this property
Returns:
the value of the property
Throws:
PropertyConstraintFailure

invert

public Operator invert(Operator op)
                throws InvalidOperator,
                       ConstraintFailure
Description copied from interface: Content
Produce an Operator that would undo the application of op on this Content.

Specified by:
invert in interface Content
Throws:
InvalidOperator
ConstraintFailure

asMapNode

public MapNode asMapNode()
Description copied from interface: Node
The Node's contents expressed as a Map. This is a shortcut for content().asMap().

Specified by:
asMapNode in interface Node
Overrides:
asMapNode in class NodeFilter

asRecordNode

public RecordNode asRecordNode()
Description copied from interface: Node
The Node's contents expressed as a Record. This is a shortcut for content().asRecord().

Specified by:
asRecordNode in interface Node
Overrides:
asRecordNode in class NodeFilter

asSequenceNode

public SequenceNode asSequenceNode()
Description copied from interface: Node
The Node's contents expressed as a Sequence. This is a shortcut for content().asSequence().

Specified by:
asSequenceNode in interface Node
Overrides:
asSequenceNode in class NodeFilter

edit

public abstract NodeContent.Editor edit()
Description copied from interface: Node
An Editor for changing the Content of this Node. If the Capability does not provide write access, then this will return null.

Specified by:
edit in interface Node
Overrides:
edit in class NodeFilter