public class BaseSequence<T,IterType extends Iterator<T>> extends Object implements Sequence<T>
| Modifier and Type | Class and Description |
|---|---|
static interface |
BaseSequence.IteratorMaker<T,IterType extends Iterator<T>> |
| Constructor and Description |
|---|
BaseSequence(BaseSequence.IteratorMaker<T,IterType> maker) |
| Modifier and Type | Method and 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.
|
public BaseSequence(BaseSequence.IteratorMaker<T,IterType> maker)
public <OutType> OutType accumulate(OutType initValue,
Accumulator<OutType,T> fn)
Sequenceaccumulate in interface Sequence<T>OutType - the type of accumulated value.initValue - the initial value to pass along to start the accumulation.fn - the accumulator which is responsible for accumulating input values.public <OutType> Yielder<OutType> toYielder(OutType initValue, YieldingAccumulator<OutType,T> accumulator)
SequencetoYielder in interface Sequence<T>OutType - the type of accumulated value.initValue - the initial value to pass along to start the accumulation.accumulator - the accumulator which is responsible for accumulating input values.YielderCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.