@Immutable protected static final class ImmutableChildReferences.EmptyChildReferences extends Object implements ChildReferences
ChildReferences.BasicContext, ChildReferences.Changes, ChildReferences.ChildInsertions, ChildReferences.Context, ChildReferences.NoChanges, ChildReferences.NoContext, ChildReferences.NoSnsIndexesContext, ChildReferences.SingleNameContext, ChildReferences.WithChanges
Modifier and Type | Field and Description |
---|---|
static ChildReferences |
INSTANCE |
UNKNOWN_SIZE
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)
Look for the child reference that has the given name and a SNS index of '1'.
|
ChildReference |
getChild(Name name,
int snsIndex)
Look for the child reference that has the given name and SNS index.
|
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.
|
ChildReference |
getChild(Path.Segment segment)
Look for the child reference that has the given name and SNS index.
|
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.
|
boolean |
isEmpty()
Determine if there are no references in this container.
|
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, using the supplied context.
|
Iterator<ChildReference> |
iterator(ChildReferences.Context context,
Collection<?> namePatterns,
NamespaceRegistry registry)
Get an iterator over all of the children that have
names (excluding same-name-sibling indexes)
matching at least one of the supplied patterns, using the supplied context. |
Iterator<ChildReference> |
iterator(Collection<?> namePatterns,
NamespaceRegistry registry)
Get an iterator over all of the children that have
names (excluding same-name-sibling indexes)
matching at least one of the supplied patterns. |
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.
|
boolean |
supportsGetChildReferenceByKey()
Return whether it is possible/feasible to
find a ChildReference for a child node given
only its NodeKey. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final ChildReferences INSTANCE
public boolean supportsGetChildReferenceByKey()
ChildReferences
find
a ChildReference for a child node given
only its NodeKey. Implementations that have very large numbers of children may provide an alternative way to
lookup
a child reference directly. In such cases, this method may
return false.supportsGetChildReferenceByKey
in interface ChildReferences
ChildReferences.getChild(NodeKey)
and ChildReferences.getChild(NodeKey, Context)
should be used to find the
ChildReference, or false if doing so is not recommended.public long size()
ChildReferences
size
in interface ChildReferences
ChildReferences.UNKNOWN_SIZE
public boolean isEmpty()
ChildReferences
size() == 0
but may be
faster.isEmpty
in interface ChildReferences
public int getChildCount(Name name)
ChildReferences
getChildCount
in interface ChildReferences
name
- the namepublic ChildReference getChild(Name name)
ChildReferences
getChild
in interface ChildReferences
name
- the name for the nodepublic ChildReference getChild(Name name, int snsIndex)
ChildReferences
getChild
in interface ChildReferences
name
- the name for the nodesnsIndex
- the same-name-sibling index; must be positivepublic ChildReference getChild(Name name, int snsIndex, ChildReferences.Context context)
ChildReferences
getChild
in interface 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(Path.Segment segment)
ChildReferences
getChild
in interface ChildReferences
segment
- the path segment, which defines the name and SNS indexpublic ChildReference getChild(NodeKey key)
ChildReferences
getChild
in interface ChildReferences
key
- the node key of the childpublic ChildReference getChild(NodeKey key, ChildReferences.Context context)
ChildReferences
getChild
in interface 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 boolean hasChild(NodeKey key)
ChildReferences
hasChild
in interface ChildReferences
key
- the node key of the childpublic Iterator<ChildReference> iterator()
ChildReferences
iterator
in interface Iterable<ChildReference>
iterator
in interface ChildReferences
public Iterator<ChildReference> iterator(Name name)
ChildReferences
iterator
in interface ChildReferences
name
- the name of the same-name-sibling nodes; may not be nullpublic Iterator<ChildReference> iterator(Name name, ChildReferences.Context context)
ChildReferences
iterator
in interface ChildReferences
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)
ChildReferences
iterator
in interface ChildReferences
context
- the context in which the child should be evaluated; may be null if there is no contextpublic Iterator<ChildReference> iterator(Collection<?> namePatterns, NamespaceRegistry registry)
ChildReferences
names
(excluding same-name-sibling indexes)
matching at least one of the supplied patterns.iterator
in interface ChildReferences
namePatterns
- the list of string literals or regex patterns describing the namesregistry
- the namespace registry, used to convert names to a form compatible with the name patternspublic Iterator<ChildReference> iterator(ChildReferences.Context context, Collection<?> namePatterns, NamespaceRegistry registry)
ChildReferences
names
(excluding same-name-sibling indexes)
matching at least one of the supplied patterns, using the supplied context. The resulting iterator is lazy where possible,
but it may be an expensive call if there are large numbers of children.iterator
in interface ChildReferences
context
- the context in which the child should be evaluated; may be null if there is no contextnamePatterns
- the list of string literals or regex patterns describing the namesregistry
- the namespace registry, used to convert names to a form compatible with the name patternspublic Iterator<NodeKey> getAllKeys()
ChildReferences
getAllKeys
in interface ChildReferences
public boolean allowsSNS()
ChildReferences
allowsSNS
in interface ChildReferences
true
if the child reference instance supports SNSCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.