Class MergedIterator<T extends Comparable<T>>
- All Implemented Interfaces:
public final class MergedIterator<T extends Comparable<T>> extends Object implements Iterator<T>Provides a merged sorted view from several sorted iterators.
If built with
removeDuplicatesset to true and an element appears in multiple iterators then it is deduplicated, that is this iterator returns the sorted union of elements.
If built with
removeDuplicatesset to false then all elements in all iterators are returned.
- The behavior is undefined if the iterators are not actually sorted.
- Null elements are unsupported.
- If removeDuplicates is set to true and if a single iterator contains duplicates then they will not be deduplicated.
- When elements are deduplicated it is not defined which one is returned.
- If removeDuplicates is set to false then the order in which duplicates are returned isn't defined.
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
Constructors Constructor Description
MergedIterator(boolean removeDuplicates, Iterator<T>... iterators)
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator