Class MergeIterator<T>
java.lang.Object
org.apache.druid.java.util.common.guava.MergeIterator<T>
- All Implemented Interfaces:
Iterator<T>
Iterator that merges a collection of sorted iterators using a comparator.
Similar to Guava's MergingIterator, but avoids calling next() on any iterator prior to returning the value
returned by the previous call to next(). This is important when merging iterators that reuse container objects
across calls to next().
Used by
Utils.mergeSorted(Iterable, Comparator).-
Constructor Summary
ConstructorsConstructorDescriptionMergeIterator(Iterable<? extends Iterator<? extends T>> sortedIterators, Comparator<? super T> comparator) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
MergeIterator
public MergeIterator(Iterable<? extends Iterator<? extends T>> sortedIterators, Comparator<? super T> comparator)
-
-
Method Details