Package org.apache.druid.common.guava
Class CombiningSequence<T>
- java.lang.Object
-
- org.apache.druid.common.guava.CombiningSequence<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <OutType> OutTypeaccumulate(OutType initValue, Accumulator<OutType,T> accumulator)Accumulate this sequence using the given accumulator.static <T> CombiningSequence<T>create(Sequence<T> baseSequence, Comparator<T> ordering, BinaryOperator<T> mergeFn)<OutType> Yielder<OutType>toYielder(OutType initValue, YieldingAccumulator<OutType,T> accumulator)Return a Yielder for accumulated sequence.
-
-
-
Method Detail
-
create
public static <T> CombiningSequence<T> create(Sequence<T> baseSequence, Comparator<T> ordering, BinaryOperator<T> mergeFn)
-
accumulate
public <OutType> OutType accumulate(OutType initValue, Accumulator<OutType,T> accumulator)Description copied from interface:SequenceAccumulate this sequence using the given accumulator.- Specified by:
accumulatein interfaceSequence<T>- Type Parameters:
OutType- the type of accumulated value.- Parameters:
initValue- the initial value to pass along to start the accumulation.accumulator- the accumulator which is responsible for accumulating input values.- Returns:
- accumulated value.
-
toYielder
public <OutType> Yielder<OutType> toYielder(OutType initValue, YieldingAccumulator<OutType,T> accumulator)
Description copied from interface:SequenceReturn a Yielder for accumulated sequence.- Specified by:
toYielderin interfaceSequence<T>- Type Parameters:
OutType- the type of accumulated value.- Parameters:
initValue- the initial value to pass along to start the accumulation.accumulator- the accumulator which is responsible for accumulating input values.- Returns:
- a Yielder for accumulated sequence.
- See Also:
Yielder
-
-