@Immutable protected static final class ImmutableChildReferences.Medium extends AbstractChildReferences
AbstractChildReferences.ChildReferenceWithNameIterator
ChildReferences.BasicContext, ChildReferences.Changes, ChildReferences.ChildInsertions, ChildReferences.Context, ChildReferences.NoChanges, ChildReferences.NoContext, ChildReferences.NoSnsIndexesContext, ChildReferences.SingleNameContext, ChildReferences.WithChanges
UNKNOWN_SIZE
Modifier | Constructor and Description |
---|---|
protected |
Medium(DocumentTranslator documentTranslator,
Document document,
String childrenFieldName,
boolean allowsSNS) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowsSNS()
Determine if the child references instance should support SNS or not.
|
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)
Get an iterator over all of the children that have same name matching the supplied value.
|
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) |
contextSensitiveIterator, defaultContext, getChild, getChild, getChild, isEmpty, iterator, iterator, iterator, supportsGetChildReferenceByKey, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected Medium(DocumentTranslator documentTranslator, Document document, String childrenFieldName, boolean allowsSNS)
public long size()
ChildReferences
ChildReferences.UNKNOWN_SIZE
public int getChildCount(Name name)
ChildReferences
name
- the namepublic 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 contextpublic 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 contextpublic ChildReference getChild(NodeKey key)
ChildReferences
key
- the node key of the childpublic boolean hasChild(NodeKey key)
ChildReferences
key
- the node key of the childpublic Iterator<ChildReference> iterator(Name name)
ChildReferences
iterator
in interface ChildReferences
iterator
in class AbstractChildReferences
name
- the name of the same-name-sibling nodes; may not be nullpublic Iterator<ChildReference> iterator()
ChildReferences
iterator
in interface Iterable<ChildReference>
iterator
in interface ChildReferences
iterator
in class AbstractChildReferences
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 contextpublic 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 contextpublic Iterator<NodeKey> getAllKeys()
ChildReferences
public StringBuilder toString(StringBuilder sb)
toString
in class AbstractChildReferences
public boolean allowsSNS()
ChildReferences
true
if the child reference instance supports SNSCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.