Class JoinIterator<E>
java.lang.Object
com.globalmentor.collections.iterators.AbstractIteratorDecorator<E>
com.globalmentor.collections.iterators.JoinIterator<E>
- Type Parameters:
E
- The type of element being iterated.
- All Implemented Interfaces:
Enumeration<E>
,Iterator<E>
An iterator that joins the contents of zero or more iterators. This class also implements the
Enumeration
interface. Element removal is not
supported.- Author:
- Garret Wilson
-
Constructor Summary
-
Method Summary
Methods inherited from class com.globalmentor.collections.iterators.AbstractIteratorDecorator
hasMoreElements, hasNext, next, nextElement
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
JoinIterator
Iterators constructor.- Parameters:
iterators
- The iterators to join.- Throws:
NullPointerException
- if any of the given iterators isnull
.
-
-
Method Details
-
getIterator
This implementation returns the first iterator in the queue that is not empty. If no further iterators remain in the queue, an empty iterator is returned. This ensures that empty iterators are discarded as soon as possible, as well as allowing the actual iteration implementation to be delegated to the base classes.
- Specified by:
getIterator
in classAbstractIteratorDecorator<E>
- Returns:
- The iterator this class decorates.
-
remove
public void remove()
-