Class LazyIteratorChain<T>
- java.lang.Object
-
- org.apache.jackrabbit.commons.iterator.LazyIteratorChain<T>
-
- Type Parameters:
T
- type of values iterating over
- All Implemented Interfaces:
java.util.Iterator<T>
public class LazyIteratorChain<T> extends java.lang.Object implements java.util.Iterator<T>
This class implements the concatenation of iterators. The implementation is lazy in the sense that advancing of any iterator is deferred as much as possible. Specifically no iterator is fully unwrapped at one single point of time.
-
-
Constructor Summary
Constructors Constructor Description LazyIteratorChain(java.util.Iterator<java.util.Iterator<T>> iterators)
LazyIteratorChain(java.util.Iterator<T>... iterators)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> java.util.Iterator<T>
chain(java.util.Iterator<java.util.Iterator<T>> iterators)
Returns the concatenation of all iterators initerators
.static <T> java.util.Iterator<T>
chain(java.util.Iterator<T>... iterators)
Returns the concatenation of all iterators initerators
.boolean
hasNext()
T
next()
void
remove()
-
-
-
Method Detail
-
chain
public static <T> java.util.Iterator<T> chain(java.util.Iterator<java.util.Iterator<T>> iterators)
Returns the concatenation of all iterators initerators
.- Type Parameters:
T
-- Parameters:
iterators
-- Returns:
-
chain
public static <T> java.util.Iterator<T> chain(java.util.Iterator<T>... iterators)
Returns the concatenation of all iterators initerators
.- Type Parameters:
T
-- Parameters:
iterators
-- Returns:
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<T>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<T>
-
-