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, wait
stream, toList
forEachRemaining
public MergingIterator(Comparator<T> comparator, Collection<CloseableIterator<T>> iterators)
public boolean hasNext()
hasNext
in interface Iterator<T>
Iterator<T>.hasNext
public T next()
next
in interface Iterator<T>
Iterator<T>.next
public void close()
close
in interface CloseableIterator<T>
close
in interface Closeable
close
in interface AutoCloseable