@@ -5487,7 +5487,6 @@ public static <T> Observable<T> amb(Iterable<? extends Observable<? extends T>>
5487
5487
return create (OperationAmb .amb (sources ));
5488
5488
}
5489
5489
5490
-
5491
5490
/**
5492
5491
* Invokes an action for each item emitted by the Observable.
5493
5492
* <p>
@@ -5696,142 +5695,216 @@ private boolean isInternalImplementation(Object o) {
5696
5695
return isInternal ;
5697
5696
}
5698
5697
}
5698
+
5699
5699
/**
5700
- * Creates a pattern that matches when both observable sequences have an available element.
5701
- * @param right Observable sequence to match with the left sequence.
5702
- * @return Pattern object that matches when both observable sequences have an available element.
5700
+ * Creates a pattern that matches when both Observable sequences have an
5701
+ * available item.
5702
+ * <p>
5703
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5704
+ *
5705
+ * @param right Observable sequence to match with the left sequence
5706
+ * @return Pattern object that matches when both Observable sequences have
5707
+ * an available item
5708
+ * @throws NullPointerException if <code>right</code> is null
5709
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">and()</a>
5703
5710
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229153.aspx'>MSDN: Observable.And</a>
5704
- * @throws NullPointerException if right is null
5705
5711
*/
5706
5712
public <T2 > Pattern2 <T , T2 > and (Observable <T2 > right ) {
5707
5713
return OperationJoinPatterns .and (this , right );
5708
5714
}
5715
+
5709
5716
/**
5710
- * Matches when the observable sequence has an available element and projects the element by invoking the selector function.
5711
- * @param selector Selector that will be invoked for elements in the source sequence.
5712
- * @return Plan that produces the projected results, to be fed (with other plans) to the When operator.
5717
+ * Matches when the Observable sequence has an available item and
5718
+ * projects the item by invoking the selector function.
5719
+ * <p>
5720
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5721
+ *
5722
+ * @param selector Selector that will be invoked for elements in the source
5723
+ * sequence
5724
+ * @return Plan that produces the projected results, to be fed (with other
5725
+ * plans) to the When operator
5726
+ * @throws NullPointerException if <code>selector</code> is null
5727
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">then()</a>
5713
5728
* @see <a href='http://msdn.microsoft.com/en-us/library/hh211662.aspx'>MSDN: Observable.Then</a>
5714
- * @throws NullPointerException if selector is null
5715
5729
*/
5716
5730
public <R > Plan0 <R > then (Func1 <T , R > selector ) {
5717
5731
return OperationJoinPatterns .then (this , selector );
5718
5732
}
5733
+
5719
5734
/**
5720
5735
* Joins together the results from several patterns.
5721
- * @param plans A series of plans created by use of the Then operator on patterns.
5722
- * @return An observable sequence with the results from matching several patterns.
5736
+ * <p>
5737
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5738
+ *
5739
+ * @param plans a series of plans created by use of the Then operator on
5740
+ * patterns
5741
+ * @return an Observable sequence with the results from matching several
5742
+ * patterns
5743
+ * @throws NullPointerException if <code>plans</code> is null
5744
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5723
5745
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5724
- * @throws NullPointerException if plans is null
5725
5746
*/
5726
5747
public static <R > Observable <R > when (Plan0 <R >... plans ) {
5727
5748
return create (OperationJoinPatterns .when (plans ));
5728
5749
}
5750
+
5729
5751
/**
5730
5752
* Joins together the results from several patterns.
5731
- * @param plans A series of plans created by use of the Then operator on patterns.
5732
- * @return An observable sequence with the results from matching several patterns.
5753
+ * <p>
5754
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5755
+ *
5756
+ * @param plans a series of plans created by use of the Then operator on
5757
+ * patterns
5758
+ * @return an Observable sequence with the results from matching several
5759
+ * patterns
5760
+ * @throws NullPointerException if <code>plans</code> is null
5761
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5733
5762
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229558.aspx'>MSDN: Observable.When</a>
5734
- * @throws NullPointerException if plans is null
5735
5763
*/
5736
5764
public static <R > Observable <R > when (Iterable <? extends Plan0 <R >> plans ) {
5737
5765
if (plans == null ) {
5738
5766
throw new NullPointerException ("plans" );
5739
5767
}
5740
5768
return create (OperationJoinPatterns .when (plans ));
5741
5769
}
5770
+
5742
5771
/**
5743
5772
* Joins the results from a pattern.
5773
+ * <p>
5774
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5775
+ *
5744
5776
* @param p1 the plan to join
5745
- * @return An observable sequence with the results from matching a pattern
5777
+ * @return an Observable sequence with the results from matching a pattern
5778
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5746
5779
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5747
5780
*/
5748
5781
@ SuppressWarnings ("unchecked" )
5749
5782
public static <R > Observable <R > when (Plan0 <R > p1 ) {
5750
5783
return create (OperationJoinPatterns .when (p1 ));
5751
5784
}
5785
+
5752
5786
/**
5753
5787
* Joins together the results from several patterns.
5788
+ * <p>
5789
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5790
+ *
5754
5791
* @param p1 a plan
5755
5792
* @param p2 a plan
5756
- * @return An observable sequence with the results from matching several patterns
5793
+ * @return an Observable sequence with the results from matching several
5794
+ * patterns
5795
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5757
5796
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5758
5797
*/
5759
5798
@ SuppressWarnings ("unchecked" )
5760
5799
public static <R > Observable <R > when (Plan0 <R > p1 , Plan0 <R > p2 ) {
5761
5800
return create (OperationJoinPatterns .when (p1 , p2 ));
5762
5801
}
5802
+
5763
5803
/**
5764
5804
* Joins together the results from several patterns.
5805
+ * <p>
5806
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5807
+ *
5765
5808
* @param p1 a plan
5766
5809
* @param p2 a plan
5767
5810
* @param p3 a plan
5768
- * @return An observable sequence with the results from matching several patterns
5811
+ * @return an Observable sequence with the results from matching several
5812
+ * patterns
5813
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5769
5814
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5770
5815
*/
5771
5816
@ SuppressWarnings ("unchecked" )
5772
5817
public static <R > Observable <R > when (Plan0 <R > p1 , Plan0 <R > p2 , Plan0 <R > p3 ) {
5773
5818
return create (OperationJoinPatterns .when (p1 , p2 , p3 ));
5774
5819
}
5820
+
5775
5821
/**
5776
5822
* Joins together the results from several patterns.
5823
+ * <p>
5824
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5825
+ *
5777
5826
* @param p1 a plan
5778
5827
* @param p2 a plan
5779
5828
* @param p3 a plan
5780
5829
* @param p4 a plan
5781
- * @return An observable sequence with the results from matching several patterns
5830
+ * @return an Observable sequence with the results from matching several
5831
+ * patterns
5832
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5782
5833
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5783
5834
*/
5784
5835
@ SuppressWarnings ("unchecked" )
5785
5836
public static <R > Observable <R > when (Plan0 <R > p1 , Plan0 <R > p2 , Plan0 <R > p3 , Plan0 <R > p4 ) {
5786
5837
return create (OperationJoinPatterns .when (p1 , p2 , p3 , p4 ));
5787
5838
}
5839
+
5788
5840
/**
5789
5841
* Joins together the results from several patterns.
5842
+ * <p>
5843
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5844
+ *
5790
5845
* @param p1 a plan
5791
5846
* @param p2 a plan
5792
5847
* @param p3 a plan
5793
5848
* @param p4 a plan
5794
5849
* @param p5 a plan
5795
- * @return An observable sequence with the results from matching several patterns
5850
+ * @return an Observable sequence with the results from matching several
5851
+ * patterns
5852
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5796
5853
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5797
5854
*/
5798
5855
@ SuppressWarnings ("unchecked" )
5799
5856
public static <R > Observable <R > when (Plan0 <R > p1 , Plan0 <R > p2 , Plan0 <R > p3 , Plan0 <R > p4 , Plan0 <R > p5 ) {
5800
5857
return create (OperationJoinPatterns .when (p1 , p2 , p3 , p4 , p5 ));
5801
5858
}
5859
+
5802
5860
/**
5803
5861
* Joins together the results from several patterns.
5862
+ * <p>
5863
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5864
+ *
5804
5865
* @param p1 a plan
5805
5866
* @param p2 a plan
5806
5867
* @param p3 a plan
5807
5868
* @param p4 a plan
5808
5869
* @param p5 a plan
5809
5870
* @param p6 a plan
5810
- * @return An observable sequence with the results from matching several patterns
5871
+ * @return an Observable sequence with the results from matching several
5872
+ * patterns
5873
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5811
5874
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5812
5875
*/
5813
5876
@ SuppressWarnings ("unchecked" )
5814
5877
public static <R > Observable <R > when (Plan0 <R > p1 , Plan0 <R > p2 , Plan0 <R > p3 , Plan0 <R > p4 , Plan0 <R > p5 , Plan0 <R > p6 ) {
5815
5878
return create (OperationJoinPatterns .when (p1 , p2 , p3 , p4 , p5 , p6 ));
5816
5879
}
5880
+
5817
5881
/**
5818
5882
* Joins together the results from several patterns.
5883
+ * <p>
5884
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5885
+ *
5819
5886
* @param p1 a plan
5820
5887
* @param p2 a plan
5821
5888
* @param p3 a plan
5822
5889
* @param p4 a plan
5823
5890
* @param p5 a plan
5824
5891
* @param p6 a plan
5825
5892
* @param p7 a plan
5826
- * @return An observable sequence with the results from matching several patterns
5893
+ * @return an Observable sequence with the results from matching several
5894
+ * patterns
5895
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5827
5896
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5828
5897
*/
5829
5898
@ SuppressWarnings ("unchecked" )
5830
5899
public static <R > Observable <R > when (Plan0 <R > p1 , Plan0 <R > p2 , Plan0 <R > p3 , Plan0 <R > p4 , Plan0 <R > p5 , Plan0 <R > p6 , Plan0 <R > p7 ) {
5831
5900
return create (OperationJoinPatterns .when (p1 , p2 , p3 , p4 , p5 , p6 , p7 ));
5832
5901
}
5902
+
5833
5903
/**
5834
5904
* Joins together the results from several patterns.
5905
+ * <p>
5906
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5907
+ *
5835
5908
* @param p1 a plan
5836
5909
* @param p2 a plan
5837
5910
* @param p3 a plan
@@ -5840,15 +5913,21 @@ public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan
5840
5913
* @param p6 a plan
5841
5914
* @param p7 a plan
5842
5915
* @param p8 a plan
5843
- * @return An observable sequence with the results from matching several patterns
5916
+ * @return an Observable sequence with the results from matching several
5917
+ * patterns
5918
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5844
5919
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5845
5920
*/
5846
5921
@ SuppressWarnings ("unchecked" )
5847
5922
public static <R > Observable <R > when (Plan0 <R > p1 , Plan0 <R > p2 , Plan0 <R > p3 , Plan0 <R > p4 , Plan0 <R > p5 , Plan0 <R > p6 , Plan0 <R > p7 , Plan0 <R > p8 ) {
5848
5923
return create (OperationJoinPatterns .when (p1 , p2 , p3 , p4 , p5 , p6 , p7 , p8 ));
5849
5924
}
5925
+
5850
5926
/**
5851
5927
* Joins together the results from several patterns.
5928
+ * <p>
5929
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5930
+ *
5852
5931
* @param p1 a plan
5853
5932
* @param p2 a plan
5854
5933
* @param p3 a plan
@@ -5858,7 +5937,9 @@ public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan
5858
5937
* @param p7 a plan
5859
5938
* @param p8 a plan
5860
5939
* @param p9 a plan
5861
- * @return An observable sequence with the results from matching several patterns
5940
+ * @return an Observable sequence with the results from matching several
5941
+ * patterns
5942
+ * @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
5862
5943
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5863
5944
*/
5864
5945
@ SuppressWarnings ("unchecked" )
@@ -5989,3 +6070,4 @@ public <K, V> Observable<Map<K, Collection<V>>> toMultimap(Func1<? super T, ? ex
5989
6070
return create (OperationToMultimap .toMultimap (this , keySelector , valueSelector , mapFactory , collectionFactory ));
5990
6071
}
5991
6072
}
6073
+
0 commit comments