Package 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.- Author:
- Matthew Wakeling
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Iterator<? extends E>
currentIterator
protected java.util.Iterator<java.util.Iterator<? extends E>>
iteratorIterator
-
Constructor Summary
Constructors Constructor Description CombinedIterator(java.util.List<java.util.Iterator<? extends E>> iterators)
Constructs a CombinedIterator from a List of Iterators.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
E
next()
void
remove()
This operation is not supported.
-
-
-
Constructor Detail
-
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
-
-