Skip to content

Commit dded0d2

Browse files
committed
javadocs: withLatestFrom diagram, @SInCE annotations, standardize on formatting and terminology, add compiler nags for missing content
1 parent a0c0818 commit dded0d2

File tree

3 files changed

+34
-25
lines changed

3 files changed

+34
-25
lines changed

src/main/java/rx/Observable.java

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2573,25 +2573,27 @@ public final static <T, Resource> Observable<T> using(
25732573

25742574
/**
25752575
* Constructs an Observable that creates a dependent resource object which is disposed of just before
2576-
* termination if <code>disposeEagerly</code> is set to true and unsubscription does not occur before termination. Otherwise
2577-
* resource disposal will occur on unsubscription. Eager disposal is particularly appropriate for a synchronous observable
2578-
* that resuses resources. <code>disposeAction</code> will only be called once per subscription.
2576+
* termination if you have set {@code disposeEagerly} to {@code true} and unsubscription does not occur
2577+
* before termination. Otherwise resource disposal will occur on unsubscription. Eager disposal is
2578+
* particularly appropriate for a synchronous Observable that resuses resources. {@code disposeAction} will
2579+
* only be called once per subscription.
25792580
* <p>
25802581
* <img width="640" height="400" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/using.png" alt="">
25812582
* <dl>
25822583
* <dt><b>Scheduler:</b></dt>
25832584
* <dd>{@code using} does not operate by default on a particular {@link Scheduler}.</dd>
25842585
* </dl>
25852586
*
2587+
* @warn "Backpressure Support" section missing from javadoc
25862588
* @param resourceFactory
25872589
* the factory function to create a resource object that depends on the Observable
25882590
* @param observableFactory
25892591
* the factory function to create an Observable
25902592
* @param disposeAction
25912593
* the function that will dispose of the resource
25922594
* @param disposeEagerly
2593-
* if true then disposal will happen either on unsubscription or just before emission of
2594-
* a terminal event (onComplete or onError).
2595+
* if {@code true} then disposal will happen either on unsubscription or just before emission of
2596+
* a terminal event ({@code onComplete} or {@code onError}).
25952597
* @return the Observable whose lifetime controls the lifetime of the dependent resource object
25962598
* @see <a href="http://reactivex.io/documentation/operators/using.html">ReactiveX operators documentation: Using</a>
25972599
* @Experimental The behavior of this can change at any time.
@@ -8805,24 +8807,24 @@ public final Observable<T> unsubscribeOn(Scheduler scheduler) {
88058807
}
88068808

88078809
/**
8808-
* Merges the specified observable sequence into this Observable sequence by using the resultSelector
8809-
* function only when the source observable sequence (this instance) produces an element.
8810-
* <code><pre>
8811-
* ----A-------B------C-----> o1
8812-
*
8813-
* --0----1-2----3-4--------> o2
8814-
*
8815-
* | | |
8816-
* V V V
8810+
* Merges the specified Observable into this Observable sequence by using the {@code resultSelector}
8811+
* function only when the source Observable (this instance) emits an item.
8812+
* <p>
8813+
* <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/withLatestFrom.png" alt="">
88178814
*
8818-
* (A,0) (B,2) (C,4)
8819-
* </pre></code>
8820-
* @param other the other observable sequence
8821-
* @param resultSelector the function to call when this Observable emits an element and the other
8822-
* observable sequence has already emitted a value.
8823-
* @return an Observable that merges the specified observable sequence into this Observable sequence
8824-
* by using the resultSelector function only when the source observable sequence
8825-
* (this instance) produces an element
8815+
* @warn "Backpressure Support" section missing from javadoc
8816+
* @warn "Scheduler" section missing from javadoc
8817+
* @param other
8818+
* the other Observable
8819+
* @param resultSelector
8820+
* the function to call when this Observable emits an item and the other Observable has already
8821+
* emitted an item, to generate the item to be emitted by the resulting Observable
8822+
* @return an Observable that merges the specified Observable into this Observable by using the
8823+
* {@code resultSelector} function only when the source Observable sequence (this instance) emits an
8824+
* item
8825+
* @Experimental The behavior of this can change at any time.
8826+
* @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
8827+
* @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
88268828
*/
88278829
@Experimental
88288830
public final <U, R> Observable<R> withLatestFrom(Observable<? extends U> other, Func2<? super T, ? super U, ? extends R> resultSelector) {

src/main/java/rx/observers/SerializedSubscriber.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@ public class SerializedSubscriber<T> extends Subscriber<T> {
3939
public SerializedSubscriber(Subscriber<? super T> s) {
4040
this(s, true);
4141
}
42+
4243
/**
4344
* Constructor for wrapping and serializing a subscriber optionally sharing the same underlying subscription
4445
* list.
45-
* @param s the subscriber to wrap and serialize
46-
* @param shareSubscriptions if {@code true}, the same subscription list is shared between this
47-
* subscriber and {@code s}.
46+
*
47+
* @param s
48+
* the subscriber to wrap and serialize
49+
* @param shareSubscriptions
50+
* if {@code true}, the same subscription list is shared between this subscriber and {@code s}.
51+
* @since 1.0.7
4852
*/
4953
public SerializedSubscriber(Subscriber<? super T> s, boolean shareSubscriptions) {
5054
super(s, shareSubscriptions);

src/main/java/rx/subscriptions/CompositeSubscription.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,12 @@ private static void unsubscribeFromAll(Collection<Subscription> subscriptions) {
150150
}
151151
Exceptions.throwIfAny(es);
152152
}
153+
153154
/**
154155
* Returns true if this composite is not unsubscribed and contains subscriptions.
156+
*
155157
* @return {@code true} if this composite is not unsubscribed and contains subscriptions.
158+
* @since 1.0.7
156159
*/
157160
public boolean hasSubscriptions() {
158161
if (!unsubscribed) {

0 commit comments

Comments
 (0)