Top Description Inners Fields Constructors Methods
rx.internal.operators

public final Class OperatorSampleWithTime<T>

extends Object
implements Observable.Operator<T, T>
Class Inheritance
All Implemented Interfaces
rx.Observable.Operator, rx.functions.Func1, rx.functions.Function
Type Parameters
<T>
the value type
Imports
java.util.concurrent.TimeUnit, java.util.concurrent.atomic.AtomicReference, rx.*, .Observable.Operator, .Scheduler.Worker, rx.exceptions.Exceptions, rx.functions.Action0, rx.observers.SerializedSubscriber

Returns an Observable that emits the results of sampling the items emitted by the source Observable at a specified time interval.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
OperatorSampleWithTime.SamplerSubscriber<T>

The source subscriber and sampler.

Field Summary

Modifier and TypeField and Description
pack-priv final Scheduler
pack-priv final long
pack-priv final TimeUnit

Constructor Summary

AccessConstructor and Description
public
OperatorSampleWithTime(long time, TimeUnit unit, Scheduler scheduler)

Method Summary

Modifier and TypeMethod and Description
public Subscriber<? super T>
call(Subscriber<? super T> child)

Implements rx.functions.Func1.call.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

schedulerback to summary
pack-priv final Scheduler scheduler
timeback to summary
pack-priv final long time
unitback to summary
pack-priv final TimeUnit unit

Constructor Detail

OperatorSampleWithTimeback to summary
public OperatorSampleWithTime(long time, TimeUnit unit, Scheduler scheduler)

Method Detail

callback to summary
public Subscriber<? super T> call(Subscriber<? super T> child)

Implements rx.functions.Func1.call.

Annotations
@Override
rx.internal.operators back to summary

pack-priv final Class OperatorSampleWithTime.SamplerSubscriber<T>

extends Subscriber<T>
implements Action0
Class Inheritance
All Implemented Interfaces
rx.functions.Action0, rx.functions.Action, rx.functions.Function

The source subscriber and sampler.

Field Summary

Modifier and TypeField and Description
private static final Object
EMPTY_TOKEN

Indicates that no value is available.

private final Subscriber<? super T>
pack-priv final AtomicReference<Object>
value

The shared value between the observer and the timed action.

Constructor Summary

AccessConstructor and Description
public
SamplerSubscriber(Subscriber<? super T> subscriber)

Method Summary

Modifier and TypeMethod and Description
public void
private void
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
t
)

Implements rx.Observer.onNext.

Provides the Observer with a new item to observe.
public void
onStart()

Overrides rx.Subscriber.onStart.

This method is invoked when the Subscriber and Observable have been connected but the Observable has not yet begun to emit items or send notifications to the Subscriber.
Inherited from rx.Subscriber:
addisUnsubscribedrequestsetProducerunsubscribe

Field Detail

EMPTY_TOKENback to summary
private static final Object EMPTY_TOKEN

Indicates that no value is available.

subscriberback to summary
private final Subscriber<? super T> subscriber

Hides rx.Subscriber.subscriber.

valueback to summary
pack-priv final AtomicReference<Object> value

The shared value between the observer and the timed action.

Constructor Detail

SamplerSubscriberback to summary
public SamplerSubscriber(Subscriber<? super T> subscriber)

Method Detail

callback to summary
public void call()

Implements rx.functions.Action0.call.

Annotations
@Override
emitIfNonEmptyback to summary
private void emitIfNonEmpty()
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 t)

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

the item emitted by the Observable

Annotations
@Override
onStartback to summary
public void onStart()

Overrides rx.Subscriber.onStart.

Doc from rx.Subscriber.onStart.

This method is invoked when the Subscriber and Observable have been connected but the Observable has not yet begun to emit items or send notifications to the Subscriber. Override this method to add any useful initialization to your subscription, for instance to initiate backpressure.

Annotations
@Override