public final class OperatorScan<R,T> extends java.lang.Object implements Observable.Operator<R,T>
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 and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
Subscriber<? super T> |
call(Subscriber<? super R> child) |
public OperatorScan(R initialValue, Func2<R,? super T,R> accumulator)
initialValue - the initial (seed) accumulator valueaccumulator - an accumulator function to be invoked on each element from the sequencepublic OperatorScan(Func2<R,? super T,R> accumulator)
accumulator - an accumulator function to be invoked on each element from the sequencepublic Subscriber<? super T> call(Subscriber<? super R> child)
call in interface Func1<Subscriber<? super R>,Subscriber<? super T>>