Class BaseSequence<T,IterType extends Iterator<T>>
- java.lang.Object
-
- org.apache.druid.java.util.common.guava.BaseSequence<T,IterType>
-
- All Implemented Interfaces:
Sequence<T>
- Direct Known Subclasses:
FrameChannelSequence
,SimpleSequence
,TopNSequence
public class BaseSequence<T,IterType extends Iterator<T>> extends Object implements Sequence<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
BaseSequence.IteratorMaker<T,IterType extends Iterator<T>>
-
Constructor Summary
Constructors Constructor Description BaseSequence(BaseSequence.IteratorMaker<T,IterType> maker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <OutType> OutType
accumulate(OutType initValue, Accumulator<OutType,T> fn)
Accumulate this sequence using the given accumulator.<OutType> Yielder<OutType>
toYielder(OutType initValue, YieldingAccumulator<OutType,T> accumulator)
Return a Yielder for accumulated sequence.
-
-
-
Constructor Detail
-
BaseSequence
public BaseSequence(BaseSequence.IteratorMaker<T,IterType> maker)
-
-
Method Detail
-
accumulate
public <OutType> OutType accumulate(OutType initValue, Accumulator<OutType,T> fn)
Description copied from interface:Sequence
Accumulate this sequence using the given accumulator.- Specified by:
accumulate
in interfaceSequence<T>
- Type Parameters:
OutType
- the type of accumulated value.- Parameters:
initValue
- the initial value to pass along to start the accumulation.fn
- 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:Sequence
Return a Yielder for accumulated sequence.- Specified by:
toYielder
in 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
-
-