CloseableIterator<T>, Closeable, AutoCloseable, Iterator<T>public class MergingIterator<T> extends Object implements CloseableIterator<T>
| Constructor | 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 | Description |
|---|---|---|
void |
close() |
Closes every CloseableIterator in this MergingIterator.
|
boolean |
hasNext() |
|
T |
next() |
|
void |
remove() |
Unsupported.
|
stream, toListforEachRemainingpublic MergingIterator(Comparator<T> comparator, Collection<CloseableIterator<T>> iterators)
public void close()
close in interface AutoCloseableclose in interface Closeableclose in interface CloseableIterator<T>