Package org.apache.druid.collections
Class CombiningIterable<T>
java.lang.Object
org.apache.druid.collections.CombiningIterable<T>
- All Implemented Interfaces:
Iterable<T>
-
Constructor Summary
ConstructorsConstructorDescriptionCombiningIterable(Iterable<T> it, Comparator<T> comparator, BinaryOperator<T> fn) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CombiningIterable<T>create(Iterable<T> it, Comparator<T> comparator, BinaryOperator<T> fn) static <T> CombiningIterable<T>createSplatted(Iterable<? extends Iterable<T>> in, Comparator<T> comparator) Creates a CombiningIterable around a MergeIterable such that equivalent elements are thrown away If there are multiple Iterables in parameter "in" with equivalent objects, there are no guarantees around which object will win.iterator()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CombiningIterable
-
-
Method Details
-
createSplatted
public static <T> CombiningIterable<T> createSplatted(Iterable<? extends Iterable<T>> in, Comparator<T> comparator) Creates a CombiningIterable around a MergeIterable such that equivalent elements are thrown away If there are multiple Iterables in parameter "in" with equivalent objects, there are no guarantees around which object will win. You will get *some* object from one of the Iterables, but which Iterable is unknown.- Type Parameters:
T- Type of object- Parameters:
in- An Iterable of Iterables to be mergedcomparator- the Comparator to determine sort and equality- Returns:
- An Iterable that is the merge of all Iterables from in such that there is only one instance of equivalent objects.
-
create
public static <T> CombiningIterable<T> create(Iterable<T> it, Comparator<T> comparator, BinaryOperator<T> fn) -
iterator
-