Class OperatorScan<R,​T>

  • Type Parameters:
    R - the aggregate and output type
    T - the input value type
    All Implemented Interfaces:
    Func1<Subscriber<? super R>,​Subscriber<? super T>>, Function, Observable.Operator<R,​T>

    public final class OperatorScan<R,​T>
    extends java.lang.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 Description
      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.
      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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Subscriber<? super T> call​(Subscriber<? super R> child)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait