Skip to content

Commit 8d77fbf

Browse files
committed
standardizing javadoc comments, adding wiki links and diagrams, for and/then/when
1 parent d511fa3 commit 8d77fbf

File tree

1 file changed

+106
-24
lines changed

1 file changed

+106
-24
lines changed

rxjava-core/src/main/java/rx/Observable.java

Lines changed: 106 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5483,7 +5483,6 @@ public static <T> Observable<T> amb(Iterable<? extends Observable<? extends T>>
54835483
return create(OperationAmb.amb(sources));
54845484
}
54855485

5486-
54875486
/**
54885487
* Invokes an action for each item emitted by the Observable.
54895488
* <p>
@@ -5692,142 +5691,216 @@ private boolean isInternalImplementation(Object o) {
56925691
return isInternal;
56935692
}
56945693
}
5694+
56955695
/**
5696-
* Creates a pattern that matches when both observable sequences have an available element.
5697-
* @param right Observable sequence to match with the left sequence.
5698-
* @return Pattern object that matches when both observable sequences have an available element.
5696+
* Creates a pattern that matches when both Observable sequences have an
5697+
* available item.
5698+
* <p>
5699+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5700+
*
5701+
* @param right Observable sequence to match with the left sequence
5702+
* @return Pattern object that matches when both Observable sequences have
5703+
* an available item
5704+
* @throws NullPointerException if <code>right</code> is null
5705+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">and()</a>
56995706
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229153.aspx'>MSDN: Observable.And</a>
5700-
* @throws NullPointerException if right is null
57015707
*/
57025708
public <T2> Pattern2<T, T2> and(Observable<T2> right) {
57035709
return OperationJoinPatterns.and(this, right);
57045710
}
5711+
57055712
/**
5706-
* Matches when the observable sequence has an available element and projects the element by invoking the selector function.
5707-
* @param selector Selector that will be invoked for elements in the source sequence.
5708-
* @return Plan that produces the projected results, to be fed (with other plans) to the When operator.
5713+
* Matches when the Observable sequence has an available item and
5714+
* projects the item by invoking the selector function.
5715+
* <p>
5716+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5717+
*
5718+
* @param selector Selector that will be invoked for elements in the source
5719+
* sequence
5720+
* @return Plan that produces the projected results, to be fed (with other
5721+
* plans) to the When operator
5722+
* @throws NullPointerException if <code>selector</code> is null
5723+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">then()</a>
57095724
* @see <a href='http://msdn.microsoft.com/en-us/library/hh211662.aspx'>MSDN: Observable.Then</a>
5710-
* @throws NullPointerException if selector is null
57115725
*/
57125726
public <R> Plan0<R> then(Func1<T, R> selector) {
57135727
return OperationJoinPatterns.then(this, selector);
57145728
}
5729+
57155730
/**
57165731
* Joins together the results from several patterns.
5717-
* @param plans A series of plans created by use of the Then operator on patterns.
5718-
* @return An observable sequence with the results from matching several patterns.
5732+
* <p>
5733+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5734+
*
5735+
* @param plans a series of plans created by use of the Then operator on
5736+
* patterns
5737+
* @return an Observable sequence with the results from matching several
5738+
* patterns
5739+
* @throws NullPointerException if <code>plans</code> is null
5740+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57195741
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
5720-
* @throws NullPointerException if plans is null
57215742
*/
57225743
public static <R> Observable<R> when(Plan0<R>... plans) {
57235744
return create(OperationJoinPatterns.when(plans));
57245745
}
5746+
57255747
/**
57265748
* Joins together the results from several patterns.
5727-
* @param plans A series of plans created by use of the Then operator on patterns.
5728-
* @return An observable sequence with the results from matching several patterns.
5749+
* <p>
5750+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5751+
*
5752+
* @param plans a series of plans created by use of the Then operator on
5753+
* patterns
5754+
* @return an Observable sequence with the results from matching several
5755+
* patterns
5756+
* @throws NullPointerException if <code>plans</code> is null
5757+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57295758
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229558.aspx'>MSDN: Observable.When</a>
5730-
* @throws NullPointerException if plans is null
57315759
*/
57325760
public static <R> Observable<R> when(Iterable<? extends Plan0<R>> plans) {
57335761
if (plans == null) {
57345762
throw new NullPointerException("plans");
57355763
}
57365764
return create(OperationJoinPatterns.when(plans));
57375765
}
5766+
57385767
/**
57395768
* Joins the results from a pattern.
5769+
* <p>
5770+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5771+
*
57405772
* @param p1 the plan to join
5741-
* @return An observable sequence with the results from matching a pattern
5773+
* @return an Observable sequence with the results from matching a pattern
5774+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57425775
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
57435776
*/
57445777
@SuppressWarnings("unchecked")
57455778
public static <R> Observable<R> when(Plan0<R> p1) {
57465779
return create(OperationJoinPatterns.when(p1));
57475780
}
5781+
57485782
/**
57495783
* Joins together the results from several patterns.
5784+
* <p>
5785+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5786+
*
57505787
* @param p1 a plan
57515788
* @param p2 a plan
5752-
* @return An observable sequence with the results from matching several patterns
5789+
* @return an Observable sequence with the results from matching several
5790+
* patterns
5791+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57535792
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
57545793
*/
57555794
@SuppressWarnings("unchecked")
57565795
public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2) {
57575796
return create(OperationJoinPatterns.when(p1, p2));
57585797
}
5798+
57595799
/**
57605800
* Joins together the results from several patterns.
5801+
* <p>
5802+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5803+
*
57615804
* @param p1 a plan
57625805
* @param p2 a plan
57635806
* @param p3 a plan
5764-
* @return An observable sequence with the results from matching several patterns
5807+
* @return an Observable sequence with the results from matching several
5808+
* patterns
5809+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57655810
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
57665811
*/
57675812
@SuppressWarnings("unchecked")
57685813
public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3) {
57695814
return create(OperationJoinPatterns.when(p1, p2, p3));
57705815
}
5816+
57715817
/**
57725818
* Joins together the results from several patterns.
5819+
* <p>
5820+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5821+
*
57735822
* @param p1 a plan
57745823
* @param p2 a plan
57755824
* @param p3 a plan
57765825
* @param p4 a plan
5777-
* @return An observable sequence with the results from matching several patterns
5826+
* @return an Observable sequence with the results from matching several
5827+
* patterns
5828+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57785829
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
57795830
*/
57805831
@SuppressWarnings("unchecked")
57815832
public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan0<R> p4) {
57825833
return create(OperationJoinPatterns.when(p1, p2, p3, p4));
57835834
}
5835+
57845836
/**
57855837
* Joins together the results from several patterns.
5838+
* <p>
5839+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5840+
*
57865841
* @param p1 a plan
57875842
* @param p2 a plan
57885843
* @param p3 a plan
57895844
* @param p4 a plan
57905845
* @param p5 a plan
5791-
* @return An observable sequence with the results from matching several patterns
5846+
* @return an Observable sequence with the results from matching several
5847+
* patterns
5848+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
57925849
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
57935850
*/
57945851
@SuppressWarnings("unchecked")
57955852
public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan0<R> p4, Plan0<R> p5) {
57965853
return create(OperationJoinPatterns.when(p1, p2, p3, p4, p5));
57975854
}
5855+
57985856
/**
57995857
* Joins together the results from several patterns.
5858+
* <p>
5859+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5860+
*
58005861
* @param p1 a plan
58015862
* @param p2 a plan
58025863
* @param p3 a plan
58035864
* @param p4 a plan
58045865
* @param p5 a plan
58055866
* @param p6 a plan
5806-
* @return An observable sequence with the results from matching several patterns
5867+
* @return an Observable sequence with the results from matching several
5868+
* patterns
5869+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
58075870
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
58085871
*/
58095872
@SuppressWarnings("unchecked")
58105873
public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan0<R> p4, Plan0<R> p5, Plan0<R> p6) {
58115874
return create(OperationJoinPatterns.when(p1, p2, p3, p4, p5, p6));
58125875
}
5876+
58135877
/**
58145878
* Joins together the results from several patterns.
5879+
* <p>
5880+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5881+
*
58155882
* @param p1 a plan
58165883
* @param p2 a plan
58175884
* @param p3 a plan
58185885
* @param p4 a plan
58195886
* @param p5 a plan
58205887
* @param p6 a plan
58215888
* @param p7 a plan
5822-
* @return An observable sequence with the results from matching several patterns
5889+
* @return an Observable sequence with the results from matching several
5890+
* patterns
5891+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
58235892
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
58245893
*/
58255894
@SuppressWarnings("unchecked")
58265895
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) {
58275896
return create(OperationJoinPatterns.when(p1, p2, p3, p4, p5, p6, p7));
58285897
}
5898+
58295899
/**
58305900
* Joins together the results from several patterns.
5901+
* <p>
5902+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5903+
*
58315904
* @param p1 a plan
58325905
* @param p2 a plan
58335906
* @param p3 a plan
@@ -5836,15 +5909,21 @@ public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan
58365909
* @param p6 a plan
58375910
* @param p7 a plan
58385911
* @param p8 a plan
5839-
* @return An observable sequence with the results from matching several patterns
5912+
* @return an Observable sequence with the results from matching several
5913+
* patterns
5914+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
58405915
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
58415916
*/
58425917
@SuppressWarnings("unchecked")
58435918
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) {
58445919
return create(OperationJoinPatterns.when(p1, p2, p3, p4, p5, p6, p7, p8));
58455920
}
5921+
58465922
/**
58475923
* Joins together the results from several patterns.
5924+
* <p>
5925+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/and_then_when.png">
5926+
*
58485927
* @param p1 a plan
58495928
* @param p2 a plan
58505929
* @param p3 a plan
@@ -5854,11 +5933,14 @@ public static <R> Observable<R> when(Plan0<R> p1, Plan0<R> p2, Plan0<R> p3, Plan
58545933
* @param p7 a plan
58555934
* @param p8 a plan
58565935
* @param p9 a plan
5857-
* @return An observable sequence with the results from matching several patterns
5936+
* @return an Observable sequence with the results from matching several
5937+
* patterns
5938+
* @see <a href="https://github.com/Netflix/RxJava/wiki/Combining-Observables#and-then-and-when">when()</a>
58585939
* @see <a href='http://msdn.microsoft.com/en-us/library/hh229889.aspx'>MSDN: Observable.When</a>
58595940
*/
58605941
@SuppressWarnings("unchecked")
58615942
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, Plan0<R> p9) {
58625943
return create(OperationJoinPatterns.when(p1, p2, p3, p4, p5, p6, p7, p8, p9));
58635944
}
58645945
}
5946+

0 commit comments

Comments
 (0)