Class CombinedIterator<T>
java.lang.Object
com.saperion.common.lang.iterator.CombinedIterator<T>
- Type Parameters:
T
- type of objects to iterate
- All Implemented Interfaces:
Iterator<T>
An Iterator
that combines two existing iterators.
It first iterates through all values of the first specified iterator and then through all values of the second specified iterator.
Iterator.remove()
is not supported.
- Author:
- agz
-
Constructor Summary
ConstructorsConstructorDescriptionCombinedIterator
(Iterator<? extends T> iterator1, Iterator<? extends T> iterator2) Creates a newCombinedIterator
, that first iterates through all values of the first specified iterator and then through all values of the second specified iterator. -
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
-
CombinedIterator
Creates a newCombinedIterator
, that first iterates through all values of the first specified iterator and then through all values of the second specified iterator. The specified iterators must not be null.- Parameters:
iterator1
- first iteratoriterator2
- second iterator
-
-
Method Details