org.intermine.util
Class CombinedIterator<E>
java.lang.Object
org.intermine.util.CombinedIterator<E>
- Type Parameters:
E - the element type of the iterator
- All Implemented Interfaces:
- java.util.Iterator<E>
public class CombinedIterator<E>
- extends java.lang.Object
- implements java.util.Iterator<E>
An Iterator that combines the contents of various other Iterators. The provided Iterators will
be followed one by one, until the last Iterator has no remaining elements.
|
Constructor Summary |
CombinedIterator(java.util.List<java.util.Iterator<? extends E>> iterators)
Constructs a CombinedIterator from a List of Iterators. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
iteratorIterator
protected java.util.Iterator<java.util.Iterator<? extends E>> iteratorIterator
currentIterator
protected java.util.Iterator<? extends E> currentIterator
CombinedIterator
public CombinedIterator(java.util.List<java.util.Iterator<? extends E>> iterators)
- Constructs a CombinedIterator from a List of Iterators. The provided Iterators should be in a
state where the desired elements are present. The act of iterating through this combined
iterator will result in the provided Iterators being iterated.
- Parameters:
iterators - a List of Iterators to be followed in order
hasNext
public boolean hasNext()
-
- Specified by:
hasNext in interface java.util.Iterator<E>
next
public E next()
-
- Specified by:
next in interface java.util.Iterator<E>
remove
public void remove()
-
This operation is not supported.
- Specified by:
remove in interface java.util.Iterator<E>