T
- the observed typeU
- the returned value typepublic abstract class ObserverToIteratorSink<T,U> extends java.lang.Object implements rx.Observer<T>, CloseableIterator<U>
Modifier and Type | Field and Description |
---|---|
protected SingleOption<U> |
current
The current value.
|
protected boolean |
done
Indicate that the stream has finished.
|
protected rx.Subscription |
handle
The original handle to the observer registration.
|
Constructor and Description |
---|
ObserverToIteratorSink(rx.Subscription handle)
Constructor, saves the handle.
|
Modifier and Type | Method and Description |
---|---|
protected void |
done()
Closes this iterator and suppresses exceptions.
|
boolean |
hasNext() |
boolean |
isUnsubscribed() |
U |
next() |
void |
remove() |
abstract boolean |
tryNext(SingleOption<? super U> out)
Try to get the next value.
|
void |
unsubscribe() |
protected boolean done
protected final rx.Subscription handle
protected final SingleOption<U> current
public ObserverToIteratorSink(rx.Subscription handle)
handle
- the handle to close when the stream finishes.public boolean hasNext()
hasNext
in interface java.util.Iterator<U>
public void remove()
remove
in interface java.util.Iterator<U>
public void unsubscribe()
unsubscribe
in interface rx.Subscription
public boolean isUnsubscribed()
isUnsubscribed
in interface rx.Subscription
protected void done()
public abstract boolean tryNext(SingleOption<? super U> out)
out
- the output where to put the value