RxJava



rx.operators
Class OperationTake

java.lang.Object
  extended by rx.operators.OperationTake

public final class OperationTake
extends java.lang.Object

Returns an Observable that emits the first num items emitted by the source Observable.

You can choose to pay attention only to the first num items emitted by an Observable by using the take operation. This operation returns an Observable that will invoke a subscribing Observer's onNext function a maximum of num times before invoking onCompleted.


Constructor Summary
OperationTake()
           
 
Method Summary
static
<T> Observable.OnSubscribeFunc<T>
take(Observable<? extends T> items, int num)
          Returns a specified number of contiguous values from the start of an observable sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationTake

public OperationTake()
Method Detail

take

public static <T> Observable.OnSubscribeFunc<T> take(Observable<? extends T> items,
                                                     int num)
Returns a specified number of contiguous values from the start of an observable sequence.

Parameters:
items -
num -
Returns:
the specified number of contiguous values from the start of the given observable sequence