public class MergingIterator<T> extends java.lang.Object implements CloseableIterator<T>
| Constructor and Description |
|---|
MergingIterator(java.util.Comparator<T> comparator,
java.util.Collection<CloseableIterator<T>> iterators)
Creates a MergingIterator over the given Collection of iterators whose elements will be
returned in the order defined by the given Comparator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes every CloseableIterator in this MergingIterator.
|
boolean |
hasNext() |
T |
next() |
void |
remove()
Unsupported.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitstream, toListpublic MergingIterator(java.util.Comparator<T> comparator, java.util.Collection<CloseableIterator<T>> iterators)
public boolean hasNext()
hasNext in interface java.util.Iterator<T>java.util.Iterator.hasNext public T next()
next in interface java.util.Iterator<T>java.util.Iterator.next public void remove()
remove in interface java.util.Iterator<T>public void close()
close in interface CloseableIterator<T>close in interface java.io.Closeableclose in interface java.lang.AutoCloseable