@@ -1054,7 +1054,7 @@ public static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6, T t7, T
1054
1054
public static <T > Observable <T > from (T t1 , T t2 , T t3 , T t4 , T t5 , T t6 , T t7 , T t8 , T t9 , T t10 ) {
1055
1055
return from (Arrays .asList (t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9 , t10 ));
1056
1056
}
1057
-
1057
+
1058
1058
/**
1059
1059
* Generates an Observable that emits a sequence of Integers within a
1060
1060
* specified range.
@@ -6571,36 +6571,6 @@ public Observable<T> doOnEach(Observer<? super T> observer) {
6571
6571
return create (OperationDoOnEach .doOnEach (this , observer ));
6572
6572
}
6573
6573
6574
- /**
6575
- * Invokes an action for each item emitted by an Observable.
6576
- * <p>
6577
- * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/doOnEach.png">
6578
- *
6579
- * @param onNext the action to invoke for each item emitted by the source
6580
- * Observable
6581
- * @return the source Observable with the side-effecting behavior applied
6582
- * @see <a href="https://github.com/Netflix/RxJava/wiki/Observable-Utility-Operators#dooneach">RxJava Wiki: doOnEach()</a>
6583
- * @see <a href="http://msdn.microsoft.com/en-us/library/hh229804.aspx">MSDN: Observable.Do</a>
6584
- */
6585
- public Observable <T > doOnEach (final Action1 <? super T > onNext ) {
6586
- Observer <T > observer = new Observer <T >() {
6587
- @ Override
6588
- public void onCompleted () {}
6589
-
6590
- @ Override
6591
- public void onError (Throwable e ) {}
6592
-
6593
- @ Override
6594
- public void onNext (T args ) {
6595
- onNext .call (args );
6596
- }
6597
-
6598
- };
6599
-
6600
-
6601
- return create (OperationDoOnEach .doOnEach (this , observer ));
6602
- }
6603
-
6604
6574
/**
6605
6575
* Invokes an action if the source Observable calls <code>onError</code>.
6606
6576
* <p>
@@ -6661,71 +6631,64 @@ public void onNext(T args) { }
6661
6631
6662
6632
return create (OperationDoOnEach .doOnEach (this , observer ));
6663
6633
}
6664
-
6634
+
6635
+
6665
6636
/**
6666
- * Invokes an action for each item emitted by an Observable.
6637
+ * Invokes an action when the source Observable calls
6638
+ * <code>onNext</code>.
6667
6639
* <p>
6668
- * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/doOnEach.e .png">
6640
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/doOnCompleted .png">
6669
6641
*
6670
- * @param onNext the action to invoke for each item emitted by the
6671
- * Observable
6672
- * @param onError the action to invoke when the source Observable calls
6673
- * <code>onError</code>
6642
+ * @param onCompleted the action to invoke when the source Observable calls
6643
+ * <code>onCompleted</code>
6674
6644
* @return the source Observable with the side-effecting behavior applied
6675
- * @see <a href="https://github.com/Netflix/RxJava/wiki/Observable-Utility-Operators#dooneach">RxJava Wiki: doOnEach ()</a>
6676
- * @see <a href="http://msdn.microsoft.com/en-us/library/hh229539 .aspx">MSDN: Observable.Do</a>
6645
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Observable-Utility-Operators#dooneach">RxJava Wiki: doOnNext ()</a>
6646
+ * @see <a href="http://msdn.microsoft.com/en-us/library/hh229804 .aspx">MSDN: Observable.Do</a>
6677
6647
*/
6678
- public Observable <T > doOnEach (final Action1 <? super T > onNext , final Action1 < Throwable > onError ) {
6648
+ public Observable <T > doOnNext (final Action1 <T > onNext ) {
6679
6649
Observer <T > observer = new Observer <T >() {
6680
6650
@ Override
6681
- public void onCompleted () {}
6651
+ public void onCompleted () { }
6682
6652
6683
6653
@ Override
6684
- public void onError (Throwable e ) {
6685
- onError .call (e );
6686
- }
6654
+ public void onError (Throwable e ) { }
6687
6655
6688
6656
@ Override
6689
- public void onNext (T args ) {
6657
+ public void onNext (T args ) {
6690
6658
onNext .call (args );
6691
6659
}
6692
6660
6693
6661
};
6694
6662
6695
-
6696
6663
return create (OperationDoOnEach .doOnEach (this , observer ));
6697
6664
}
6698
-
6665
+
6699
6666
/**
6700
- * Invokes an action for each item emitted by an Observable.
6667
+ * Invokes an action for each item emitted by the Observable.
6701
6668
* <p>
6702
- * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/doOnEach.ce. png">
6669
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/doOnEach.png">
6703
6670
*
6704
- * @param onNext the action to invoke for each item emitted by the
6705
- * Observable
6706
- * @param onError the action to invoke when the source Observable calls
6707
- * <code>onError</code>
6708
- * @param onCompleted the action to invoke when the source Observable calls
6709
- * <code>onCompleted</code>
6671
+ * @param observer the action to invoke for each item emitted by the source
6672
+ * Observable
6710
6673
* @return the source Observable with the side-effecting behavior applied
6711
6674
* @see <a href="https://github.com/Netflix/RxJava/wiki/Observable-Utility-Operators#dooneach">RxJava Wiki: doOnEach()</a>
6712
- * @see <a href="http://msdn.microsoft.com/en-us/library/hh229830 .aspx">MSDN: Observable.Do</a>
6675
+ * @see <a href="http://msdn.microsoft.com/en-us/library/hh229307 .aspx">MSDN: Observable.Do</a>
6713
6676
*/
6714
- public Observable <T > doOnEach (final Action1 <? super T > onNext , final Action1 < Throwable > onError , final Action0 onCompleted ) {
6677
+ public Observable <T > doOnEach (final Action1 <Notification < T >> onNotification ) {
6715
6678
Observer <T > observer = new Observer <T >() {
6716
6679
@ Override
6717
6680
public void onCompleted () {
6718
- onCompleted .call ();
6681
+ onNotification .call (new Notification < T >() );
6719
6682
}
6720
6683
6721
6684
@ Override
6722
6685
public void onError (Throwable e ) {
6723
- onError .call (e );
6686
+ onNotification .call (new Notification < T >( e ) );
6724
6687
}
6725
6688
6726
6689
@ Override
6727
- public void onNext (T args ) {
6728
- onNext .call (args );
6690
+ public void onNext (T v ) {
6691
+ onNotification .call (new Notification < T >( v ) );
6729
6692
}
6730
6693
6731
6694
};
0 commit comments