org.modeshape.jcr.cache.document

## Class NodeCacheIterator

- java.lang.Object
- - org.modeshape.jcr.cache.document.NodeCacheIterator

- All Implemented Interfaces:
    Iterator<NodeKey>

      public class NodeCacheIterator
      extends Object
      implements Iterator<NodeKey>

  An iterator that returns all of the keys for the nodes in the cache that are below the specified starting node.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `NodeCacheIterator.NodeFilter`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NodeCacheIterator(NodeCache cache, NodeKey startingNode)` Create a new iterator over the nodes in the supplied node cache that are at or below the supplied starting node.
    `NodeCacheIterator(NodeCache cache, NodeKey startingNode, NodeCacheIterator.NodeFilter filter)` Create a new iterator over the nodes in the supplied node cache that are at or below the supplied starting node.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()`
    `NodeKey` | `next()`
    `protected void` | `nextNode()`
    `void` | `remove()`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### NodeCacheIterator

          public NodeCacheIterator(NodeCache cache,
                           NodeKey startingNode)

      Create a new iterator over the nodes in the supplied node cache that are at or below the supplied starting node.
      Parameters:
        `cache` - the node cache; may not be null
        `startingNode` - the starting node and the root of the subgraph; may not be null

    - #### NodeCacheIterator

          public NodeCacheIterator(NodeCache cache,
                           NodeKey startingNode,
                           NodeCacheIterator.NodeFilter filter)

      Create a new iterator over the nodes in the supplied node cache that are at or below the supplied starting node.
      Parameters:
        `cache` - the node cache; may not be null
        `startingNode` - the starting node and the root of the subgraph; may not be null
        `filter` - the filter that should be used to determine which nodes are exposed by this iterator; may be null if the iterator should not filter

  - ### Method Detail

    - #### hasNext

          public final boolean hasNext()

      Specified by:
        `hasNext` in interface `Iterator<NodeKey>`

    - #### next

          public final NodeKey next()

      Specified by:
        `next` in interface `Iterator<NodeKey>`

    - #### nextNode

          protected final void nextNode()

    - #### remove

          public final void remove()

      Specified by:
        `remove` in interface `Iterator<NodeKey>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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