Ejemplo n.º 1
0
 /**
  * Returns a specified number of contiguous values from the start of an observable sequence.
  *
  * @param items
  * @param predicate a function to test each source element for a condition
  * @return
  */
 public static <T> Func1<Observer<T>, Subscription> takeWhile(
     final Observable<T> items, final Func1<T, Boolean> predicate) {
   return takeWhileWithIndex(items, OperationTake.<T>skipIndex(predicate));
 }
Ejemplo n.º 2
0
 /**
  * Returns a specified number of contiguous values from the start of an observable sequence.
  *
  * @param items
  * @param num
  * @return
  */
 public static <T> Func1<Observer<T>, Subscription> take(
     final Observable<T> items, final int num) {
   return takeWhileWithIndex(items, OperationTake.<T>numPredicate(num));
 }