Class CombiningIterable<T>

java.lang.Object
org.apache.druid.collections.CombiningIterable<T>
All Implemented Interfaces:
Iterable<T>

public class CombiningIterable<T> extends Object implements Iterable<T>
  • Constructor Details

  • 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 merged
      comparator - 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

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>