Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ModeShape Distribution 3.0.0.Alpha6
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.jcr.cache.document
Class ImmutableChildReferences.Segmented

    java.lang.Object
      org.modeshape.jcr.cache.document.AbstractChildReferences
          org.modeshape.jcr.cache.document.ImmutableChildReferences.Segmented

All Implemented Interfaces:
  Iterable<ChildReference>, ChildReferences

Enclosing class:
  ImmutableChildReferences

    @Immutable
    public static class ImmutableChildReferences.Segmented

extends AbstractChildReferences

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`

Field Summary
`protected WorkspaceCache` | `cache`
`protected long` | `totalSize`

Constructor Summary
`ImmutableChildReferences.Segmented(WorkspaceCache cache, ChildReferences firstSegment, DocumentTranslator.ChildReferencesInfo info)`

Method Summary
`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(Name name)` 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, iterator, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### cache

    protected final WorkspaceCache cache

### totalSize

    protected final long totalSize

Constructor Detail

### ImmutableChildReferences.Segmented

    public ImmutableChildReferences.Segmented(WorkspaceCache cache,
                                              ChildReferences firstSegment,
                                              DocumentTranslator.ChildReferencesInfo info)

Method Detail

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

  Returns:
    the total number of children; never negative

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

  Parameters:
    `name` - the name
  Returns:
    the number of siblings with the supplied name; never negative

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

  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

### hasChild

    public boolean hasChild(NodeKey key)

  Description copied from interface: `ChildReferences`
  Determine if this contains a reference to the specified child.

  Parameters:
    `key` - the node key of the child
  Returns:
    true if there is a child reference, or false if there is none

### getChild

    public ChildReference getChild(NodeKey key)

  Description copied from interface: `ChildReferences`
  Look for the child reference that has the node key.

  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.

  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

### 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`
  Overrides:
    `iterator` in class `AbstractChildReferences`
  Parameters:
    `name` - the name of the same-name-sibling nodes; may not be null
  Returns:
    the iterator; never null

### iterator

    public Iterator<ChildReference> iterator()

  Description copied from interface: `ChildReferences`
  Get an iterator over all of the children.

  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.

  Returns:
    the iterator over the keys; never null

### toString

    public StringBuilder toString(StringBuilder sb)

  Specified by:
    `toString` in class `AbstractChildReferences`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ModeShape Distribution 3.0.0.Alpha6
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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