|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object storage.memory.memContent
The base class for all of the Content classes in this package. The create and ingest methods act as static abstract constructors for these classes, using the NodeType to determine which class to construct.
Field Summary | |
protected java.util.Set |
allContents
|
protected CacheMap |
nodeContents
Cache for all NodeContent instances created using this memContent. |
Constructor Summary | |
protected |
memContent()
|
Method Summary | |
protected Node |
assignNode(NodeContent c,
java.lang.Object property,
Node node)
Called whenever a Node value is assigned anywhere in memContent. |
static memContent |
create(NodeType t)
Create a new instance of the given type. |
protected abstract NodeContent |
createNodeContent(Node n,
Capability cap,
storage.framework.RepoServices s)
Create a NodeContent object with the memContent, and the given Node, Capability, and RepoServices. |
protected NodeContent |
findNodeContent(Node n)
If a NodeContent record already exists (in canonical cache), return it. |
java.lang.Object |
getValue(java.lang.Object idx,
NodeContent c)
Access the property value, given a property. |
static memContent |
ingest(Content c)
|
NodeContent.Editor |
initEdit(Node n,
storage.framework.RepoServices f)
|
memOperator |
invert(memOperator op,
NodeContent c)
Compute the inverse of an Operator. |
Operator |
invert(Operator op,
NodeContent c)
Produce an Operator that would undo the application of op
on this Content. |
boolean |
isValidProperty(java.lang.Object property)
Check for the validity of a given property value. |
void |
modify(memOperator op,
NodeContent c)
Apply an Operator to this content object. |
NodeContent |
nodeContent(Node n,
storage.framework.RepoServices f,
Capability cap)
Maybe create a NodeContent object that matches this memContent with the given Node. |
java.util.Iterator |
properties()
A sequence of all of the properties currently indexing the contents if this Content. |
protected void |
rememberNodeContent(NodeContent c,
boolean canonical)
Store a Node->NodeContent pair in the cache. |
protected Node |
seatNode(NodeContent c,
Node node)
Ensure that any Node references are within the current Repository. |
int |
size()
The number of properties contained in this Content object. |
NodeType |
type()
The type of this Content object. |
Getter |
value(java.lang.Object obj,
NodeContent c)
A generic Getter for property values, given a property. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final CacheMap nodeContents
protected final java.util.Set allContents
Constructor Detail |
protected memContent()
Method Detail |
public static memContent create(NodeType t)
t
- the NodeType of the object that will be created
public static memContent ingest(Content c)
public final java.lang.Object getValue(java.lang.Object idx, NodeContent c) throws PropertyConstraintFailure
storage.memory.MemContentI
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.
getValue
in interface storage.memory.MemContentI
idx
- the Object that identifies this property
PropertyConstraintFailure
public void modify(memOperator op, NodeContent c) throws InvalidOperator, ConstraintFailure
modify
in interface storage.memory.MemContentI
op
- the memOperator to apply this content to
InvalidOperator
ConstraintFailure
public Operator invert(Operator op, NodeContent c) throws InvalidOperator, ConstraintFailure
storage.memory.MemContentI
op
on this Content.
invert
in interface storage.memory.MemContentI
InvalidOperator
ConstraintFailure
public memOperator invert(memOperator op, NodeContent c) throws InvalidOperator, ConstraintFailure
InvalidOperator
ConstraintFailure
protected NodeContent findNodeContent(Node n)
n
- a Node reference
protected void rememberNodeContent(NodeContent c, boolean canonical)
findNodeContent(Node)
.
c
- a NodeContent referencecanonical
- if this is the canonical reference, then store in the
special index as well.protected abstract NodeContent createNodeContent(Node n, Capability cap, storage.framework.RepoServices s)
n
- a Node associated with this memContentcap
- a Capability restricting access to operationss
- the RepoServices needed to manage Txns and create Nodes
public NodeContent.Editor initEdit(Node n, storage.framework.RepoServices f)
public NodeContent nodeContent(Node n, storage.framework.RepoServices f, Capability cap)
n
- the Node that this content is associated withcap
- a Capability restricting access (or null for default).
protected Node seatNode(NodeContent c, Node node)
node
- the Node being referencedc
- the NodeContent context for this reference
protected Node assignNode(NodeContent c, java.lang.Object property, Node node)
Node.bareNode()
,
ensuring that the reference stored is in the same repository, and then
that all indices are properly updated.
c
- the NodeContent context for this assignmentproperty
- the property being assignednode
- the Node being assigned as the value for property
public NodeType type()
Necessarily a NodeType type, and always a specific instance of MapType, RecordType or SequenceType.
public int size()
public java.util.Iterator properties()
public boolean isValidProperty(java.lang.Object property)
property
- the property to be checked
public Getter value(java.lang.Object obj, NodeContent c)
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.
obj
- the Object that identifies this property
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |