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.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Func2 | |
| private final Func0 | |
| private static final Object |
| Access | Constructor and Description |
|---|---|
| public | OperatorScan(final R
the initial (seed) accumulator value initialValue, Func2<R, ? super T, R> an accumulator function to be invoked on each element from the sequence accumulator)Applies an accumulator function over an observable sequence and returns each intermediate result with the specified source and accumulator. |
| public | |
| public | OperatorScan(final Func2<R, ? super T, R>
an accumulator function to be invoked on each element from the sequence 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 |
|---|---|
| public Subscriber |
| accumulator | back to summary |
|---|---|
| pack-priv final Func2<R, ? super T, R> accumulator | |
| initialValueFactory | back to summary |
|---|---|
| private final Func0<R> initialValueFactory | |
| NO_INITIAL_VALUE | back to summary |
|---|---|
| private static final Object NO_INITIAL_VALUE | |
| OperatorScan | back to summary |
|---|---|
| public OperatorScan(final 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 | back to summary |
|---|---|
| public OperatorScan(Func0<R> initialValueFactory, Func2<R, ? super T, R> accumulator) | |
| OperatorScan | back to summary |
|---|---|
| public OperatorScan(final 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.
| |
| call | back to summary |
|---|---|
| public Subscriber Implements rx.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Subscriber | |
| pack-priv volatile boolean | |
| pack-priv boolean | |
| pack-priv Throwable | |
| pack-priv boolean | missed
Missed a terminal event. |
| pack-priv long | missedRequested
Missed a request. |
| pack-priv volatile Producer | producer
The current producer. |
| pack-priv final Queue | |
| pack-priv final AtomicLong | requested
The current requested amount. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | |
| pack-priv void | |
| pack-priv void | |
| public void | onCompleted()
Implements rx. Observable has finished sending push-based notifications.
|
| public void | onError(Throwable
the exception encountered by the Observable e)Implements rx. Observable has experienced an error condition.
|
| public void | onNext(R
the item emitted by the Observable t)Implements rx. |
| public void | request(long
the maximum number of items you want this Producer to produce, or n)Long.MAX_VALUE if you
want the Producer to produce items at its own paceImplements rx. |
| public void |
| child | back to summary |
|---|---|
| pack-priv final Subscriber<? super R> child | |
| done | back to summary |
|---|---|
| pack-priv volatile boolean done | |
| emitting | back to summary |
|---|---|
| pack-priv boolean emitting | |
| error | back to summary |
|---|---|
| pack-priv Throwable error | |
| missed | back to summary |
|---|---|
| pack-priv boolean missed Missed a terminal event. | |
| missedRequested | back to summary |
|---|---|
| pack-priv long missedRequested Missed a request. | |
| producer | back to summary |
|---|---|
| pack-priv volatile Producer producer The current producer. | |
| queue | back to summary |
|---|---|
| pack-priv final Queue<Object> queue | |
| requested | back to summary |
|---|---|
| pack-priv final AtomicLong requested The current requested amount. | |
| InitialProducer | back to summary |
|---|---|
| public InitialProducer(R initialValue, Subscriber<? super R> child) | |
| checkTerminated | back to summary |
|---|---|
| pack-priv boolean checkTerminated(boolean d, boolean empty, Subscriber<? super R> child) | |
| emit | back to summary |
|---|---|
| pack-priv void emit() | |
| emitLoop | back to summary |
|---|---|
| pack-priv void emitLoop() | |
| onCompleted | back to summary |
|---|---|
| public void onCompleted() Implements rx. Doc from rx. Notifies the Observer that the
The
| |
| onError | back to summary |
|---|---|
| public void onError(Throwable e) Implements rx. Doc from rx. Notifies the Observer that the
If the | |
| onNext | back to summary |
|---|---|
| public void onNext(R t) Implements rx. Doc from rx. Provides the Observer with a new item to observe.
The
The
| |
| request | back to summary |
|---|---|
| public void request(long n) Implements rx. Doc from rx. Request a certain maximum number of items from this Producer. This is a way of requesting backpressure.
To disable backpressure, pass
Requests are additive but if a sequence of requests totals more than request(100); request(Long.MAX_VALUE-1);
| |
| setProducer | back to summary |
|---|---|
| public void setProducer(Producer p) | |