Class ExpandingNodeIterator<T>
java.lang.Object
com.saperion.common.lang.iterator.ExpandingNodeIterator<T>
- Type Parameters:
T
- type of objects to iterate
- All Implemented Interfaces:
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:
-
Constructor Summary
ConstructorsConstructorDescriptionExpandingNodeIterator
(Iterator<? extends T> iterator, IteratorResolver<T, T> iteratorResolver) Creates a newExpandingNodeIterator
. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
ExpandingNodeIterator
public ExpandingNodeIterator(Iterator<? extends T> iterator, IteratorResolver<T, T> iteratorResolver) Creates a newExpandingNodeIterator
. The specified iterator and the specified iterator resolver must not benull
.- Parameters:
iterator
- main level iteratoriteratorResolver
-IteratorResolver
- See Also:
-
-
Method Details