Class YieldingSequenceBase<T>

java.lang.Object
org.apache.druid.java.util.common.guava.YieldingSequenceBase<T>
All Implemented Interfaces:
Sequence<T>
Direct Known Subclasses:
ExplodingSequence, MergeSequence, ParallelMergeCombiningSequence, ScanQueryOffsetSequence, SkippingSequence

public abstract class YieldingSequenceBase<T> extends Object implements Sequence<T>
A Sequence that is based entirely on the Yielder implementation.

This is a base class to simplify the creation of Sequences.

  • Constructor Details

    • YieldingSequenceBase

      public YieldingSequenceBase()
  • Method Details

    • accumulate

      public <OutType> OutType accumulate(OutType initValue, Accumulator<OutType,T> accumulator)
      Description copied from interface: Sequence
      Accumulate this sequence using the given accumulator.
      Specified by:
      accumulate in interface Sequence<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.