Top Description Inners Constructors Methods
rx.internal.operators

public final Class BlockingOperatorNext

extends Object
Class Inheritance
Imports
java.util.*, java.util.concurrent.*, java.util.concurrent.atomic.AtomicInteger, rx.*, .Observable, rx.exceptions.Exceptions

Returns an Iterable that blocks until the Observable emits another item, then returns that item.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <
the value type
T
>
Iterable<T>

Returns:

an Iterable that behaves like a blocking version of items
next
(final Observable<? extends T>
the Observable to observe
items
)

Returns an Iterable that blocks until the Observable emits another item, then returns that item.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BlockingOperatorNextback to summary
private BlockingOperatorNext()

Method Detail

nextback to summary
public static <T> Iterable<T> next(final Observable<? extends T> items)

Returns an Iterable that blocks until the Observable emits another item, then returns that item.

Parameters
<T>
the value type
items:Observable<? extends T>

the Observable to observe

Returns:Iterable<T>

an Iterable that behaves like a blocking version of items

rx.internal.operators back to summary

pack-priv final Class BlockingOperatorNext.NextIterator<T>

extends Object
implements Iterator<T>
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
private Throwable
private boolean
private boolean
private final Observable<? extends T>
private T
private final BlockingOperatorNext.NextObserver<T>
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv
NextIterator(Observable<? extends T> items, BlockingOperatorNext.NextObserver<T> observer)

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.
private boolean
public T
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.
public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

errorback to summary
private Throwable error
hasNextback to summary
private boolean hasNext
isNextConsumedback to summary
private boolean isNextConsumed
itemsback to summary
private final Observable<? extends T> items
nextback to summary
private T next
observerback to summary
private final BlockingOperatorNext.NextObserver<T> observer
startedback to summary
private boolean started

Constructor Detail

NextIteratorback to summary
pack-priv NextIterator(Observable<? extends T> items, BlockingOperatorNext.NextObserver<T> observer)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

Annotations
@Override
moveToNextback to summary
private boolean moveToNext()
Annotations
@SuppressWarnings:unchecked
nextback to summary
public T next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:T

the next element in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.

Annotations
@Override
rx.internal.operators back to summary

pack-priv final Class BlockingOperatorNext.NextObserver<T>

extends Subscriber<Notification<? extends T>>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final BlockingQueue<Notification<? extends T>>
pack-priv final AtomicInteger

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
onCompleted()

Implements rx.Observer.onCompleted.

Notifies the Observer that the Observable has finished sending push-based notifications.
public void
onError(Throwable
the exception encountered by the Observable
e
)

Implements rx.Observer.onError.

Notifies the Observer that the Observable has experienced an error condition.
public void
onNext(Notification<? extends T>
the item emitted by the Observable
args
)

Implements rx.Observer.onNext.

Provides the Observer with a new item to observe.
pack-priv void
setWaiting(int value)

public Notification<? extends T>
Inherited from rx.Subscriber:
addisUnsubscribedonStartrequestsetProducerunsubscribe

Field Detail

bufback to summary
private final BlockingQueue<Notification<? extends T>> buf
waitingback to summary
pack-priv final AtomicInteger waiting

Constructor Detail

NextObserverback to summary
pack-priv NextObserver()

Method Detail

onCompletedback to summary
public void onCompleted()

Implements rx.Observer.onCompleted.

Doc from rx.Observer.onCompleted.

Notifies the Observer that the Observable has finished sending push-based notifications.

The Observable will not call this method if it calls onError.

Annotations
@Override
onErrorback to summary
public void onError(Throwable e)

Implements rx.Observer.onError.

Doc from rx.Observer.onError.

Notifies the Observer that the Observable has experienced an error condition.

If the Observable calls this method, it will not thereafter call onNext or onCompleted.

Parameters
e:Throwable

the exception encountered by the Observable

Annotations
@Override
onNextback to summary
public void onNext(Notification<? extends T> args)

Implements rx.Observer.onNext.

Doc from rx.Observer.onNext.

Provides the Observer with a new item to observe.

The Observable may call this method 0 or more times.

The Observable will not call this method again after it calls either onCompleted or onError.

Parameters
args:Notification<? extends T>

the item emitted by the Observable

Annotations
@Override
setWaitingback to summary
pack-priv void setWaiting(int value)
takeNextback to summary
public Notification<? extends T> takeNext() throws InterruptedException