|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.jcr.cache.document.AbstractChildReferences
org.modeshape.jcr.cache.document.SessionChildReferences
@ThreadSafe public class SessionChildReferences
A ChildReferences
implementation that projects a single, changeable view of the child references of a node, allowing
child references to be added to the end of the persisted state. This view always reflects the view's changes on top of the
current persisted list of child references, even when the persisted state is changed by other sessions.
For example, consider a node A that has two children, B and C. If a SessionChildReferences
instance is created for A,
then it includes ChildReference
for nodes B and C. If a new child node, D, is created and appended to the list, the
MutableChildReferences object will show three children: B, C and D. Before these changes are saved, however, another client
adds to node A a new node, E, and persists those changes. At that instant, the MutableChildReferences will see four children
for node A: the persisted children B, C and E, plus the transient node D that has not yet been saved.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.modeshape.jcr.cache.document.AbstractChildReferences |
---|
AbstractChildReferences.ChildReferenceWithNameIterator |
Nested classes/interfaces inherited from interface org.modeshape.jcr.cache.ChildReferences |
---|
ChildReferences.BasicContext, ChildReferences.Changes, ChildReferences.ChildInsertions, ChildReferences.Context, ChildReferences.NoChanges, ChildReferences.NoContext, ChildReferences.NoSnsIndexesContext, ChildReferences.SingleNameContext, ChildReferences.WithChanges |
Constructor Summary | |
---|---|
SessionChildReferences(ChildReferences persisted,
MutableChildReferences appended,
SessionNode.ChangedChildren changedChildren)
|
Method Summary | |
---|---|
protected Iterator<ChildReference> |
createIterator(ChildReferences.Context context)
|
protected Iterator<ChildReference> |
createIterator(Name name,
ChildReferences.Context context)
|
Iterator<NodeKey> |
getAllKeys()
Get the keys for all of the children. |
ChildReference |
getChild(Name name,
int snsIndex,
ChildReferences.Context context)
Look for the child reference that has the given name and SNS index. |
ChildReference |
getChild(NodeKey key)
Look for the child reference that has the node key. |
ChildReference |
getChild(NodeKey key,
ChildReferences.Context context)
Look for the child reference that has the node key. |
int |
getChildCount(Name name)
Return the number of nodes that have the supplied name. |
boolean |
hasChild(NodeKey key)
Determine if this contains a reference to the specified child. |
Iterator<ChildReference> |
iterator()
Get an iterator over all of the children. |
Iterator<ChildReference> |
iterator(ChildReferences.Context context)
Get an iterator over all child references in this collection, but base the SNS indexes upon those already consumed. |
Iterator<ChildReference> |
iterator(Name name,
ChildReferences.Context context)
Get an iterator over all of the children that have same name matching the supplied value. |
long |
size()
Get the total number of child references for the node, including all subsequent blocks of ChildReferences. |
StringBuilder |
toString(StringBuilder sb)
|
Methods inherited from class org.modeshape.jcr.cache.document.AbstractChildReferences |
---|
contextSensitiveIterator, getChild, getChild, getChild, isEmpty, iterator, iterator, iterator, iterator, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SessionChildReferences(ChildReferences persisted, MutableChildReferences appended, SessionNode.ChangedChildren changedChildren)
Method Detail |
---|
public long size()
ChildReferences
public int getChildCount(Name name)
ChildReferences
name
- the name
public ChildReference getChild(Name name, int snsIndex, ChildReferences.Context context)
ChildReferences
name
- the name for the nodesnsIndex
- the same-name-sibling index; must be positivecontext
- the context in which the child should be evaluated; may be null if there is no context
public boolean hasChild(NodeKey key)
ChildReferences
key
- the node key of the child
public ChildReference getChild(NodeKey key)
ChildReferences
key
- the node key of the child
public ChildReference getChild(NodeKey key, ChildReferences.Context context)
ChildReferences
key
- the node key of the childcontext
- the context in which the child should be evaluated; may be null if there is no context
public Iterator<ChildReference> iterator()
ChildReferences
public Iterator<ChildReference> iterator(Name name, ChildReferences.Context context)
ChildReferences
iterator
in interface ChildReferences
iterator
in class AbstractChildReferences
name
- the name of the same-name-sibling nodes; may not be nullcontext
- the context in which the child should be evaluated; may be null if there is no context
protected Iterator<ChildReference> createIterator(Name name, ChildReferences.Context context)
public Iterator<ChildReference> iterator(ChildReferences.Context context)
AbstractChildReferences
iterator
in interface ChildReferences
iterator
in class AbstractChildReferences
context
- the context in which the child should be evaluated; may be null if there is no context
protected Iterator<ChildReference> createIterator(ChildReferences.Context context)
public Iterator<NodeKey> getAllKeys()
ChildReferences
public StringBuilder toString(StringBuilder sb)
toString
in class AbstractChildReferences
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |