Class ExpandingNodeIterator<T>

  • Type Parameters:
    T - type of objects to iterate
    All Implemented Interfaces:
    java.util.Iterator<T>

    public final class ExpandingNodeIterator<T>
    extends java.lang.Object
    implements java.util.Iterator<T>

    An ExpandingNodeIterator iterates through all nodes of a virtual two level data structure.

    It iterates through the objects of the specified main iterator. After returning the main-level object a call to the specified IteratorResolver is executed to get an iterator for the optional virtual sub elements. If such an iterator is found, all the sub elements will be iterated through after the main object.

    Then, the main iterator will step to the next main object and its sub elements and so on.

    Iterator.remove() is not supported.

    Author:
    agz
    See Also:
    ExpandingLeafIterator, ExpandingSubLevelIterator
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<T>
      • next

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<T>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object