Class NodeIteratorAdapter

  • All Implemented Interfaces:
    java.util.Iterator, javax.jcr.NodeIterator, javax.jcr.RangeIterator

    public class NodeIteratorAdapter
    extends RangeIteratorDecorator
    implements javax.jcr.NodeIterator
    Adapter class for turning RangeIterators or Iterators into NodeIterators.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static javax.jcr.NodeIterator EMPTY
      Static instance of an empty NodeIterator.
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeIteratorAdapter​(java.util.Collection collection)
      Creates an iterator for the given collection.
      NodeIteratorAdapter​(java.util.Iterator iterator)
      Creates an adapter for the given Iterator.
      NodeIteratorAdapter​(java.util.Iterator iterator, long size)  
      NodeIteratorAdapter​(javax.jcr.RangeIterator iterator)
      Creates an adapter for the given RangeIterator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.jcr.Node nextNode()
      Returns the next node.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, hasNext, next, remove
      • Methods inherited from interface javax.jcr.RangeIterator

        getPosition, getSize, skip
    • Field Detail

      • EMPTY

        public static final javax.jcr.NodeIterator EMPTY
        Static instance of an empty NodeIterator.
    • Constructor Detail

      • NodeIteratorAdapter

        public NodeIteratorAdapter​(javax.jcr.RangeIterator iterator)
        Creates an adapter for the given RangeIterator.
        Parameters:
        iterator - iterator of Nodes
      • NodeIteratorAdapter

        public NodeIteratorAdapter​(java.util.Iterator iterator)
        Creates an adapter for the given Iterator.
        Parameters:
        iterator - iterator of Nodes
      • NodeIteratorAdapter

        public NodeIteratorAdapter​(java.util.Iterator iterator,
                                   long size)
      • NodeIteratorAdapter

        public NodeIteratorAdapter​(java.util.Collection collection)
        Creates an iterator for the given collection.
        Parameters:
        collection - collection of Nodes
    • Method Detail

      • nextNode

        public javax.jcr.Node nextNode()
                                throws java.util.NoSuchElementException
        Returns the next node.
        Specified by:
        nextNode in interface javax.jcr.NodeIterator
        Returns:
        next node
        Throws:
        java.util.NoSuchElementException - if there is no next node