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 AbstractChildReferences

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

All Implemented Interfaces:
  Iterable<ChildReference>, ChildReferences

Direct Known Subclasses:
  ImmutableChildReferences.Medium, ImmutableChildReferences.Segmented, MutableChildReferences, SessionChildReferences

    public abstract class AbstractChildReferences

extends Object
implements ChildReferences

An partial `ChildReferences` implementation that can serve as a base class to provide default implementations of some methods to simplify other implementations.

Nested Class Summary
`protected static class` | `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
`AbstractChildReferences()`

Method Summary
`protected Iterator<ChildReference>` | `contextSensitiveIterator(Iterator<ChildReference> original, ChildReferences.Context context)`
`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(Path.Segment segment)` Look for the child reference that has the given name and SNS index.
`boolean` | `isEmpty()` Determine if there are no references in this container.
`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(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(ChildReferences.Context context, Name name)`
`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.
`String` | `toString()`
`abstract StringBuilder` | `toString(StringBuilder sb)`

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

Methods inherited from interface org.modeshape.jcr.cache.ChildReferences
`getAllKeys, getChild, getChild, getChild, getChildCount, hasChild, iterator, size`

Constructor Detail

### AbstractChildReferences

    public AbstractChildReferences()

Method Detail

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

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

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

  Get an iterator over all child references in this collection, but base the SNS indexes upon those already consumed.

  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

### contextSensitiveIterator

    protected Iterator<ChildReference> contextSensitiveIterator(Iterator<ChildReference> original,
                                                                ChildReferences.Context context)

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

### iterator

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

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### toString

    public abstract StringBuilder toString(StringBuilder sb)

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.