Top Description Inners Constructors Methods
rx.internal.operators

public final Class BlockingOperatorMostRecent

extends Object
Class Inheritance
Imports
java.util.*, rx.Observable, .Subscriber, rx.exceptions.Exceptions

Returns an Iterable that always returns the item most recently emitted by an Observable, or a seed value if no item has yet been emitted.

Nested and Inner Type Summary

Modifier and TypeClass and Description
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 always returns the item most recently emitted by source, or initialValue if source has not yet emitted any items
mostRecent
(final Observable<? extends T>
the source Observable
source
,
final T
a default item to return from the Iterable if source has not yet emitted any items
initialValue
)

Returns an Iterable that always returns the item most recently emitted by the Observable.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BlockingOperatorMostRecentback to summary
private BlockingOperatorMostRecent()

Method Detail

mostRecentback to summary
public static <T> Iterable<T> mostRecent(final Observable<? extends T> source, final T initialValue)

Returns an Iterable that always returns the item most recently emitted by the Observable.

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

the source Observable

initialValue:T

a default item to return from the Iterable if source has not yet emitted any items

Returns:Iterable<T>

an Iterable that always returns the item most recently emitted by source, or initialValue if source has not yet emitted any items

rx.internal.operators back to summary

pack-priv final Class BlockingOperatorMostRecent.MostRecentObserver<T>

extends Subscriber<T>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv volatile Object

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Iterator<T>

Returns:

the Iterator instance
getIterable
()

The Iterator return is not thread safe.

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(T
the item emitted by the Observable
args
)

Implements rx.Observer.onNext.

Provides the Observer with a new item to observe.
Inherited from rx.Subscriber:
addisUnsubscribedonStartrequestsetProducerunsubscribe

Field Detail

valueback to summary
pack-priv volatile Object value

Constructor Detail

MostRecentObserverback to summary
pack-priv MostRecentObserver(T value)

Method Detail

getIterableback to summary
public Iterator<T> getIterable()

The Iterator return is not thread safe. In other words don't call Iterator#hasNext() in one thread expect Iterator#next() called from a different thread to work.

Returns:Iterator<T>

the Iterator instance

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(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:T

the item emitted by the Observable

Annotations
@Override