Class MappedSequence<T,Out>

java.lang.Object
org.apache.druid.java.util.common.guava.MappedSequence<T,Out>
All Implemented Interfaces:
Sequence<Out>

public class MappedSequence<T,Out> extends Object implements Sequence<Out>
  • Constructor Details

    • MappedSequence

      public MappedSequence(Sequence<T> baseSequence, Function<? super T,? extends Out> fn)
  • Method Details

    • accumulate

      public <OutType> OutType accumulate(OutType initValue, Accumulator<OutType,Out> 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.
    • toYielder

      public <OutType> Yielder<OutType> toYielder(OutType initValue, YieldingAccumulator<OutType,Out> accumulator)
      Description copied from interface: Sequence
      Return a Yielder for accumulated sequence.
      Specified by:
      toYielder 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:
      a Yielder for accumulated sequence.
      See Also: