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, toList
forEachRemaining
public MergingIterator(Comparator<T> comparator, Collection<CloseableIterator<T>> iterators)
public void close()
close
in interface AutoCloseable
close
in interface Closeable
close
in interface CloseableIterator<T>