private static class Iterators.MergingIterator<T> extends UnmodifiableIterator<T>
Retrieving a single element takes approximately O(log(M)) time, where M is the number of iterators. (Retrieving all elements takes approximately O(N*log(M)) time, where N is the total number of elements.)
| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.Queue<PeekingIterator<T>> |
queue |
| Constructor and Description |
|---|
MergingIterator(java.lang.Iterable<? extends java.util.Iterator<? extends T>> iterators,
java.util.Comparator<? super T> itemComparator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
T |
next() |
removefinal java.util.Queue<PeekingIterator<T>> queue
public boolean hasNext()
public T next()