Class OperatorScan<R,T>

  • All Implemented Interfaces:
    Func1<Subscriber<? super R>,Subscriber<? super T>>, Function, Observable.Operator<R,T>


    public final class OperatorScan<R,T>
    extends Object
    implements Observable.Operator<R,T>
    Returns an Observable that applies a function to the first item emitted by a source Observable, then feeds the result of that function along with the second item emitted by an Observable into the same function, and so on until all items have been emitted by the source Observable, emitting the result of each of these iterations.

    This sort of function is sometimes called an accumulator.

    Note that when you pass a seed to scan the resulting Observable will emit that seed as its first emitted item.

    • Constructor Summary

      Constructors

      Constructor and Description
      OperatorScan(Func0<R> initialValueFactory, Func2<R,? super T,R> accumulator)
       
      OperatorScan(Func2<R,? super T,R> accumulator)
      Applies an accumulator function over an observable sequence and returns each intermediate result with the specified source and accumulator.
      OperatorScan(R initialValue, Func2<R,? super T,R> accumulator)
      Applies an accumulator function over an observable sequence and returns each intermediate result with the specified source and accumulator.