Package rx.internal.operators
Class OperatorScan<R,T>
java.lang.Object
rx.internal.operators.OperatorScan<R,T>
- Type Parameters:
R
- the aggregate and output typeT
- the input value type
- All Implemented Interfaces:
Func1<Subscriber<? super R>,
,Subscriber<? super T>> Function
,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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionApplies an accumulator function over an observable sequence and returns each intermediate result with the specified source and 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
-
Field Details
-
initialValueFactory
-
accumulator
-
NO_INITIAL_VALUE
-
-
Constructor Details
-
OperatorScan
Applies an accumulator function over an observable sequence and returns each intermediate result with the specified source and accumulator.- Parameters:
initialValue
- the initial (seed) accumulator valueaccumulator
- an accumulator function to be invoked on each element from the sequence- See Also:
-
OperatorScan
-
OperatorScan
Applies an accumulator function over an observable sequence and returns each intermediate result with the specified source and accumulator.- Parameters:
accumulator
- an accumulator function to be invoked on each element from the sequence- See Also:
-
-
Method Details