@@ -3659,6 +3659,34 @@ public final Integer call(Integer t1, T t2) {
3659
3659
}
3660
3660
});
3661
3661
}
3662
+
3663
+ /**
3664
+ * Returns an Observable that counts the total number of items emitted by the source Observable and emits
3665
+ * this count as a 64-bit Long.
3666
+ * <p>
3667
+ * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/longCount.png" alt="">
3668
+ * <dl>
3669
+ * <dt><b>Backpressure Support:</b></dt>
3670
+ * <dd>This operator does not support backpressure because by intent it will receive all values and reduce
3671
+ * them to a single {@code onNext}.</dd>
3672
+ * <dt><b>Scheduler:</b></dt>
3673
+ * <dd>{@code longCount} does not operate by default on a particular {@link Scheduler}.</dd>
3674
+ * </dl>
3675
+ *
3676
+ * @return an Observable that emits a single item: the number of items emitted by the source Observable as a
3677
+ * 64-bit Long item
3678
+ * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Mathematical-and-Aggregate-Operators#count-and-longcount">RxJava wiki: count</a>
3679
+ * @see <a href="http://msdn.microsoft.com/en-us/library/hh229120.aspx">MSDN: Observable.LongCount</a>
3680
+ * @see #count()
3681
+ */
3682
+ public final Observable <Long > countLong () {
3683
+ return reduce (0L , new Func2 <Long , T , Long >() {
3684
+ @ Override
3685
+ public final Long call (Long t1 , T t2 ) {
3686
+ return t1 + 1 ;
3687
+ }
3688
+ });
3689
+ }
3662
3690
3663
3691
/**
3664
3692
* Returns an Observable that mirrors the source Observable, except that it drops items emitted by the
@@ -4992,34 +5020,6 @@ public final Observable<T> limit(int num) {
4992
5020
return take (num );
4993
5021
}
4994
5022
4995
- /**
4996
- * Returns an Observable that counts the total number of items emitted by the source Observable and emits
4997
- * this count as a 64-bit Long.
4998
- * <p>
4999
- * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/longCount.png" alt="">
5000
- * <dl>
5001
- * <dt><b>Backpressure Support:</b></dt>
5002
- * <dd>This operator does not support backpressure because by intent it will receive all values and reduce
5003
- * them to a single {@code onNext}.</dd>
5004
- * <dt><b>Scheduler:</b></dt>
5005
- * <dd>{@code longCount} does not operate by default on a particular {@link Scheduler}.</dd>
5006
- * </dl>
5007
- *
5008
- * @return an Observable that emits a single item: the number of items emitted by the source Observable as a
5009
- * 64-bit Long item
5010
- * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Mathematical-and-Aggregate-Operators#count-and-longcount">RxJava wiki: count</a>
5011
- * @see <a href="http://msdn.microsoft.com/en-us/library/hh229120.aspx">MSDN: Observable.LongCount</a>
5012
- * @see #count()
5013
- */
5014
- public final Observable <Long > longCount () {
5015
- return reduce (0L , new Func2 <Long , T , Long >() {
5016
- @ Override
5017
- public final Long call (Long t1 , T t2 ) {
5018
- return t1 + 1 ;
5019
- }
5020
- });
5021
- }
5022
-
5023
5023
/**
5024
5024
* Returns an Observable that applies a specified function to each item emitted by the source Observable and
5025
5025
* emits the results of these function applications.
0 commit comments