public class MergingIterator<T> extends Object implements CloseableIterator<T>
| Constructor and Description |
|---|
MergingIterator(Comparator<T> comparator,
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, toListforEachRemainingpublic MergingIterator(Comparator<T> comparator, Collection<CloseableIterator<T>> iterators)
public boolean hasNext()
hasNext in interface Iterator<T>Iterator<T>.hasNextpublic T next()
next in interface Iterator<T>Iterator<T>.nextpublic void close()
close in interface CloseableIterator<T>close in interface Closeableclose in interface AutoCloseable