org.modeshape.jcr.cache.document

## Class ImmutableChildReferences.EmptyChildReferences

- java.lang.Object
- - org.modeshape.jcr.cache.document.ImmutableChildReferences.EmptyChildReferences

- All Implemented Interfaces:
    Iterable<ChildReference>, ChildReferences
  Enclosing class:
    ImmutableChildReferences

      @Immutable
      protected static final class ImmutableChildReferences.EmptyChildReferences
      extends Object
      implements ChildReferences

- - ### Nested Class Summary

    - ### 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`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static ChildReferences` | `INSTANCE`

    - ### Fields inherited from interface org.modeshape.jcr.cache.ChildReferences

      `UNKNOWN_SIZE`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 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 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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          public static final ChildReferences INSTANCE

  - ### Method Detail

    - #### supportsGetChildReferenceByKey

          public boolean supportsGetChildReferenceByKey()

      Description copied from interface: `ChildReferences`
      Return whether it is possible/feasible to `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.
      Specified by:
        `supportsGetChildReferenceByKey` in interface `ChildReferences`
      Returns:
        true if `ChildReferences.getChild(NodeKey)` and `ChildReferences.getChild(NodeKey, Context)` should be used to find the ChildReference, or false if doing so is not recommended.

    - #### size

          public long size()

      Description copied from interface: `ChildReferences`
      Get the total number of child references for the node, including all subsequent blocks of ChildReferences.
      Specified by:
        `size` in interface `ChildReferences`
      Returns:
        the total number of children, or `ChildReferences.UNKNOWN_SIZE`

    - #### isEmpty

          public boolean isEmpty()

      Description copied from interface: `ChildReferences`
      Determine if there are no references in this container. This is equivalent to calling `size() == 0` but may be faster.
      Specified by:
        `isEmpty` in interface `ChildReferences`
      Returns:
        true if there are no references in this container, or false if there are.

    - #### getChildCount

          public int getChildCount(Name name)

      Description copied from interface: `ChildReferences`
      Return the number of nodes that have the supplied name. If there are no siblings with the same supplied name, this method will return 1; otherwise it will return the number of same-name-siblings.
      Specified by:
        `getChildCount` in interface `ChildReferences`
      Parameters:
        `name` - the name
      Returns:
        the number of siblings with the supplied name; never negative

    - #### getChild

          public ChildReference getChild(Name name)

      Description copied from interface: `ChildReferences`
      Look for the child reference that has the given name and a SNS index of '1'.
      Specified by:
        `getChild` in interface `ChildReferences`
      Parameters:
        `name` - the name for the node
      Returns:
        the child reference, or null if there is no such child

    - #### getChild

          public ChildReference getChild(Name name,
                                int snsIndex)

      Description copied from interface: `ChildReferences`
      Look for the child reference that has the given name and SNS index.
      Specified by:
        `getChild` in interface `ChildReferences`
      Parameters:
        `name` - the name for the node
        `snsIndex` - the same-name-sibling index; must be positive
      Returns:
        the child reference, or null if there is no such child

    - #### getChild

          public ChildReference getChild(Name name,
                                int snsIndex,
                                ChildReferences.Context context)

      Description copied from interface: `ChildReferences`
      Look for the child reference that has the given name and SNS index.
      Specified by:
        `getChild` in interface `ChildReferences`
      Parameters:
        `name` - the name for the node
        `snsIndex` - the same-name-sibling index; must be positive
        `context` - the context in which the child should be evaluated; may be null if there is no context
      Returns:
        the child reference, or null if there is no such child

    - #### getChild

          public ChildReference getChild(Path.Segment segment)

      Description copied from interface: `ChildReferences`
      Look for the child reference that has the given name and SNS index.
      Specified by:
        `getChild` in interface `ChildReferences`
      Parameters:
        `segment` - the path segment, which defines the name and SNS index
      Returns:
        the child reference, or null if there is no such child

    - #### getChild

          public ChildReference getChild(NodeKey key)

      Description copied from interface: `ChildReferences`
      Look for the child reference that has the node key.
      Specified by:
        `getChild` in interface `ChildReferences`
      Parameters:
        `key` - the node key of the child
      Returns:
        the child reference, or null if there is no such child

    - #### getChild

          public ChildReference getChild(NodeKey key,
                                ChildReferences.Context context)

      Description copied from interface: `ChildReferences`
      Look for the child reference that has the node key.
      Specified by:
        `getChild` in interface `ChildReferences`
      Parameters:
        `key` - the node key of the child
        `context` - the context in which the child should be evaluated; may be null if there is no context
      Returns:
        the child reference, or null if there is no such child

    - #### hasChild

          public boolean hasChild(NodeKey key)

      Description copied from interface: `ChildReferences`
      Determine if this contains a reference to the specified child.
      Specified by:
        `hasChild` in interface `ChildReferences`
      Parameters:
        `key` - the node key of the child
      Returns:
        true if there is a child reference, or false if there is none

    - #### iterator

          public Iterator<ChildReference> iterator()

      Description copied from interface: `ChildReferences`
      Get an iterator over all of the children.
      Specified by:
        `iterator` in interface `Iterable<ChildReference>`
      Specified by:
        `iterator` in interface `ChildReferences`
      Returns:
        the iterator; never null

    - #### iterator

          public Iterator<ChildReference> iterator(Name name)

      Description copied from interface: `ChildReferences`
      Get an iterator over all of the children that have same name matching the supplied value. This essentially returns an iterator over all of the same-name-siblings.
      Specified by:
        `iterator` in interface `ChildReferences`
      Parameters:
        `name` - the name of the same-name-sibling nodes; may not be null
      Returns:
        the iterator; never null

    - #### iterator

          public Iterator<ChildReference> iterator(Name name,
                                          ChildReferences.Context context)

      Description copied from interface: `ChildReferences`
      Get an iterator over all of the children that have same name matching the supplied value. This essentially returns an iterator over all of the same-name-siblings.
      Specified by:
        `iterator` in interface `ChildReferences`
      Parameters:
        `name` - the name of the same-name-sibling nodes; may not be null
        `context` - the context in which the child should be evaluated; may be null if there is no context
      Returns:
        the iterator; never null

    - #### iterator

          public Iterator<ChildReference> iterator(ChildReferences.Context context)

      Description copied from interface: `ChildReferences`
      Get an iterator over all child references in this collection, using the supplied context.
      Specified by:
        `iterator` in interface `ChildReferences`
      Parameters:
        `context` - the context in which the child should be evaluated; may be null if there is no context
      Returns:
        the iterator over all references; never null

    - #### iterator

          public Iterator<ChildReference> iterator(Collection<?> namePatterns,
                                          NamespaceRegistry registry)

      Description copied from interface: `ChildReferences`
      Get an iterator over all of the children that have names matching at least one of the supplied patterns.
      Specified by:
        `iterator` in interface `ChildReferences`
      Parameters:
        `namePatterns` - the list of string literals or regex patterns describing the names
        `registry` - the namespace registry, used to convert names to a form compatible with the name patterns
      Returns:
        the iterator; never null

    - #### iterator

          public Iterator<ChildReference> iterator(ChildReferences.Context context,
                                          Collection<?> namePatterns,
                                          NamespaceRegistry registry)

      Description copied from interface: `ChildReferences`
      Get an iterator over all of the children that have names 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.
      Specified by:
        `iterator` in interface `ChildReferences`
      Parameters:
        `context` - the context in which the child should be evaluated; may be null if there is no context
        `namePatterns` - the list of string literals or regex patterns describing the names
        `registry` - the namespace registry, used to convert names to a form compatible with the name patterns
      Returns:
        the iterator; never null

    - #### getAllKeys

          public Iterator<NodeKey> getAllKeys()

      Description copied from interface: `ChildReferences`
      Get the keys for all of the children. The resulting iterator is lazy where possible, but it may be an expensive call if there are large numbers of children.
      Specified by:
        `getAllKeys` in interface `ChildReferences`
      Returns:
        the iterator over the keys; never null

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.