T - the element typepublic class MostRecent<T> extends ObservableToIterableAdapter<T,T>
Note that it is possible one doesn't receive the last value of a fixed-length observable sequence in case the last next() call is is quickly followed by a finish() event.
The returned iterator throws UnsupportedOperationException for its remove() method.
| Modifier and Type | Field and Description |
|---|---|
protected T |
initialValue
The initial value to have.
|
observable| Constructor and Description |
|---|
MostRecent(Observable<? extends T> observable,
T initialValue)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected ObserverToIteratorSink<T,T> |
run(java.io.Closeable handle)
The factory method to return an iterator and hand over the close handle
to the original registration to the source.
|
iteratorprotected final T initialValue
public MostRecent(@Nonnull
Observable<? extends T> observable,
T initialValue)
observable - the source observableinitialValue - the initial value@Nonnull protected ObserverToIteratorSink<T,T> run(@Nonnull java.io.Closeable handle)
ObservableToIterableAdapterrun in class ObservableToIterableAdapter<T,T>handle - the closea handle