Skip to content

Commit ea2249a

Browse files
committed
Filling in more gaps in the javadocs.
1 parent dd52daf commit ea2249a

18 files changed

+128
-52
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ public static <T> Notification<T> createOnCompleted() {
6161
}
6262

6363
/**
64-
* @warn javadoc missing
65-
* @return
64+
* Creates and returns a {@code Notification} of variety {@code Kind.OnCompleted}.
65+
*
66+
* @warn param "type" undescribed
67+
* @param type
68+
* @return an {@code OnCompleted} variety of {@code Notification}
6669
*/
6770
@SuppressWarnings("unchecked")
6871
public static <T> Notification<T> createOnCompleted(Class<T> type) {
@@ -149,7 +152,7 @@ public boolean isOnNext() {
149152
}
150153

151154
/**
152-
* @warn javadoc missing
155+
* Forwards this notification on to a specified {@link Observer}.
153156
*/
154157
public void accept(Observer<? super T> observer) {
155158
if (isOnNext()) {

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3214,16 +3214,18 @@ public final <R> Observable<R> cast(final Class<R> klass) {
32143214
}
32153215

32163216
/**
3217-
* Collects values emitted by the source Observable into a single mutable data structure and returns an
3217+
* Collects items emitted by the source Observable into a single mutable data structure and returns an
32183218
* Observable that emits this structure.
32193219
* <p>
3220+
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/collect.png">
3221+
* <p>
32203222
* This is a simplified version of {@code reduce} that does not need to return the state on each pass.
32213223
*
3222-
* @warn javadocs incomplete; no marble diagram for this operator
32233224
* @param state
3224-
* @warn javadocs incomplete; "state" parameter not described
3225+
* the mutable data structure that will collect the items
32253226
* @param collector
3226-
* @warn javadocs incomplete; "collector" parameter not described
3227+
* a function that accepts the {@code state} and an emitted item, and modifies {@code state}
3228+
* accordingly
32273229
* @return an Observable that emits the result of collecting the values emitted by the source Observable
32283230
* into a single mutable data structure
32293231
*/
@@ -5502,7 +5504,7 @@ public final <R> Observable<R> scan(R initialValue, Func2<R, ? super T, R> accum
55025504
* It is possible for an Observable to invoke its Subscribers' methods asynchronously, perhaps from
55035505
* different threads. This could make such an Observable poorly-behaved, in that it might try to invoke
55045506
* {@code onCompleted} or {@code onError} before one of its {@code onNext} invocations, or it might call
5505-
* {@code onNext} from two different threads simultaneously. You can force such an Observable to be
5507+
* {@code onNext} from two different threads concurrently. You can force such an Observable to be
55065508
* well-behaved and sequential by applying the {@code serialize} method to it.
55075509
* <p>
55085510
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/synchronize.png">

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ public final void unsubscribe() {
6363
}
6464

6565
/**
66-
* @warn javadoc missing
67-
* @return
66+
* Indicates whether this Subscriber has unsubscribed from its Observable.
67+
*
68+
* @return {@code true} if this Subscriber has unsubscribed from its Observable, {@code false} otherwise
6869
*/
6970
public final boolean isUnsubscribed() {
7071
return cs.isUnsubscribed();

rxjava-core/src/main/java/rx/exceptions/CompositeException.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,20 @@ public CompositeException(Collection<Throwable> errors) {
5454
}
5555

5656
/**
57-
* @warn javadoc missing
57+
* Retrieves the list of exceptions that make up the {@code CompositeException}
58+
*
59+
* @return the exceptions that make up the {@code CompositeException}, as a {@link List} of
60+
* {@link Throwable}s
5861
*/
5962
public List<Throwable> getExceptions() {
6063
return exceptions;
6164
}
6265

63-
/**
64-
* Returns a concatenation of the composite exceptions.
65-
*
66-
* @warn return value undocumented (e.g. how are multiple exceptions delimited?)
67-
*/
6866
@Override
6967
public String getMessage() {
7068
return message;
7169
}
7270

73-
/**
74-
* @warn javadoc missing
75-
*/
7671
@Override
7772
public synchronized Throwable getCause() {
7873
return cause;

rxjava-core/src/main/java/rx/exceptions/OnErrorFailedException.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,23 @@ public class OnErrorFailedException extends RuntimeException {
2626
private static final long serialVersionUID = -419289748403337611L;
2727

2828
/**
29-
* @warn javadoc missing
29+
* Customizes the {@code Throwable} with a custom message and wraps it before it is to be re-thrown as an
30+
* {@code OnErrorFailedException}.
31+
*
32+
* @param message
33+
* the message to assign to the {@code Throwable} to re-throw
34+
* @param e
35+
* the {@code Throwable} to re-throw
3036
*/
3137
public OnErrorFailedException(String message, Throwable e) {
3238
super(message, e);
3339
}
3440

3541
/**
36-
* @warn javadoc missing
42+
* Wraps the {@code Throwable} before it is to be re-thrown as an {@code OnErrorFailedException}.
43+
*
44+
* @param e
45+
* the {@code Throwable} to re-throw
3746
*/
3847
public OnErrorFailedException(Throwable e) {
3948
super(e.getMessage(), e);

rxjava-core/src/main/java/rx/exceptions/OnErrorNotImplementedException.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,23 @@ public class OnErrorNotImplementedException extends RuntimeException {
3333
private static final long serialVersionUID = -6298857009889503852L;
3434

3535
/**
36-
* @warn javadoc missing
36+
* Customizes the {@code Throwable} with a custom message and wraps it before it is to be re-thrown as an
37+
* {@code OnErrorNotImplementedException}.
38+
*
39+
* @param message
40+
* the message to assign to the {@code Throwable} to re-throw
41+
* @param e
42+
* the {@code Throwable} to re-throw
3743
*/
3844
public OnErrorNotImplementedException(String message, Throwable e) {
3945
super(message, e);
4046
}
4147

4248
/**
43-
* @warn javadoc missing
49+
* Wraps the {@code Throwable} before it is to be re-thrown as an {@code OnErrorNotImplementedException}.
50+
*
51+
* @param e
52+
* the {@code Throwable} to re-throw
4453
*/
4554
public OnErrorNotImplementedException(Throwable e) {
4655
super(e.getMessage(), e);

rxjava-core/src/main/java/rx/exceptions/OnErrorThrowable.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ public Object getValue() {
4646
}
4747

4848
/**
49-
* @warn javadoc missing
50-
* @return
49+
* Indicates whether or not there is a value associated with this {@code OnErrorThrowable}
50+
*
51+
* @return {@code true} if there is a value associated with this {@code OnErrorThrowable}, otherwise
52+
* {@code false}
5153
*/
5254
public boolean isValueNull() {
5355
return hasValue;

rxjava-core/src/main/java/rx/plugins/RxJavaPlugins.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ public class RxJavaPlugins {
3434
private final AtomicReference<RxJavaDefaultSchedulers> schedulerOverrides = new AtomicReference<RxJavaDefaultSchedulers>();
3535

3636
/**
37-
* @warn javadoc missing
38-
* @return
37+
* Retrieves the single {@code RxJavaPlugins} instance.
38+
*
39+
* @return the single {@code RxJavaPlugins} instance
3940
*/
4041
public static RxJavaPlugins getInstance() {
4142
return INSTANCE;

rxjava-core/src/main/java/rx/schedulers/Schedulers.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ public static Scheduler io() {
111111
}
112112

113113
/**
114-
* @warn javadoc missing
115-
* @return
114+
* Creates and returns a {@code TestScheduler}, which is useful for debugging. It allows you to test
115+
* schedules of events by manually advancing the clock at whatever pace you choose.
116+
*
117+
* @return a {@code TestScheduler} meant for debugging
116118
*/
117119
public static TestScheduler test() {
118120
return new TestScheduler();

rxjava-core/src/main/java/rx/schedulers/TestScheduler.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
import rx.subscriptions.Subscriptions;
2828

2929
/**
30-
* @warn javadoc class description missing
30+
* The {@code TestScheduler} is useful for debugging. It allows you to test schedules of events by manually
31+
* advancing the clock at whatever pace you choose.
3132
*/
3233
public class TestScheduler extends Scheduler {
3334
private final Queue<TimedAction> queue = new PriorityQueue<TimedAction>(11, new CompareActionsByTime());
@@ -72,22 +73,33 @@ public long now() {
7273
}
7374

7475
/**
75-
* @warn javadoc missing
76+
* Moves the Scheduler's clock forward by a specified amount of time.
77+
*
78+
* @param delayTime
79+
* the amount of time to move the Scheduler's clock forward
80+
* @param unit
81+
* the units of time that {@code delayTime} is expressed in
7682
*/
7783
public void advanceTimeBy(long delayTime, TimeUnit unit) {
7884
advanceTimeTo(time + unit.toNanos(delayTime), TimeUnit.NANOSECONDS);
7985
}
8086

8187
/**
82-
* @warn javadoc missing
88+
* Moves the Scheduler's clock to a particular moment in time.
89+
*
90+
* @param delayTime
91+
* the point in time to move the Scheduler's clock to
92+
* @param unit
93+
* the units of time that {@code delayTime} is expressed in
8394
*/
8495
public void advanceTimeTo(long delayTime, TimeUnit unit) {
8596
long targetTime = unit.toNanos(delayTime);
8697
triggerActions(targetTime);
8798
}
8899

89100
/**
90-
* @warn javadoc missing
101+
* Triggers any actions that have not yet been triggered and that are scheduled to be triggered at or
102+
* before this Scheduler's present time.
91103
*/
92104
public void triggerActions() {
93105
triggerActions(time);

rxjava-core/src/main/java/rx/schedulers/TimeInterval.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,42 @@
1616
package rx.schedulers;
1717

1818
/**
19-
* @warn javadoc class description missing
19+
* A {@code TimeInterval} represents an item emitted by an {@code Observable} along with the amount of time that
20+
* elapsed either since the emission of the previous item or (if there was no previous item) since the
21+
* {@code Observable} was first subscribed to.
2022
*/
2123
public class TimeInterval<T> {
2224
private final long intervalInMilliseconds;
2325
private final T value;
2426

27+
/**
28+
* Creates a {@code TimeInterval} object.
29+
*
30+
* @param intervalInMilliseconds
31+
* the number of milliseconds between the time when {@code value} was emitted and the item that
32+
* was emitted immediately prior to {@code value}, or, if there was no such prior item, since the
33+
* initial subscription to the {@code Observable}
34+
* @param value
35+
* the item emitted by the Observable
36+
*/
2537
public TimeInterval(long intervalInMilliseconds, T value) {
2638
this.value = value;
2739
this.intervalInMilliseconds = intervalInMilliseconds;
2840
}
2941

3042
/**
31-
* Returns the interval, expressed in milliseconds.
43+
* Returns the time interval, expressed in milliseconds.
3244
*
33-
* @return the interval in milliseconds
45+
* @return the time interval in milliseconds
3446
*/
3547
public long getIntervalInMilliseconds() {
3648
return intervalInMilliseconds;
3749
}
3850

3951
/**
40-
* @warn javadoc missing
41-
* @return
52+
* Returns the item that was emitted by the Observable after this time interval.
53+
*
54+
* @return the item that was emitted by the Observable
4255
*/
4356
public T getValue() {
4457
return value;

rxjava-core/src/main/java/rx/subjects/AsyncSubject.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@
5353
public final class AsyncSubject<T> extends Subject<T, T> {
5454

5555
/**
56-
* @warn javadoc missing
57-
* @return
56+
* Creates and returns a new {@code AsyncSubject}.
57+
*
58+
* @return the new {@code AsyncSubject}
5859
*/
5960
public static <T> AsyncSubject<T> create() {
6061
final SubjectSubscriptionManager<T> state = new SubjectSubscriptionManager<T>();

rxjava-core/src/main/java/rx/subjects/PublishSubject.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@
4848
public final class PublishSubject<T> extends Subject<T, T> {
4949

5050
/**
51-
* @warn javadoc missing
52-
* @return
51+
* Creates and returns a new {@code PublishSubject}.
52+
*
53+
* @return the new {@code PublishSubject}
5354
*/
5455
public static <T> PublishSubject<T> create() {
5556
final SubjectSubscriptionManager<T> state = new SubjectSubscriptionManager<T>();

rxjava-core/src/main/java/rx/subjects/TestSubject.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
*
4949
* @param <T>
5050
* the type of item observed by and emitted by the subject
51+
* @warn javadoc seems misleading
5152
*/
5253
public final class TestSubject<T> extends Subject<T, T> {
5354

rxjava-core/src/main/java/rx/subscriptions/BooleanSubscription.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,20 @@ private BooleanSubscription(Action0 action) {
4343
}
4444

4545
/**
46-
* @warn javadoc missing
47-
* @return
46+
* Creates a {@code BooleanSubscription} without unsubscribe behavior.
47+
*
48+
* @return the created {@code BooleanSubscription}
4849
*/
4950
public static BooleanSubscription create() {
5051
return new BooleanSubscription();
5152
}
5253

5354
/**
54-
* @warn javadoc missing
55-
* @return
55+
* Creates a {@code BooleanSubscription} with a specified function to invoke upon unsubscribe.
56+
*
57+
* @param onUnsubscribe
58+
* an {@link Action0} to invoke upon unsubscribe
59+
* @return the created {@code BooleanSubscription}
5660
*/
5761
public static BooleanSubscription create(Action0 onUnsubscribe) {
5862
return new BooleanSubscription(onUnsubscribe);

rxjava-core/src/main/java/rx/subscriptions/CompositeSubscription.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,13 @@ public boolean isUnsubscribed() {
114114
}
115115

116116
/**
117-
* @warn javadoc missing
117+
* Adds a new {@link Subscription} to this {@code CompositeSubscription} if the
118+
* {@code CompositeSubscription} is not yet unsubscribed. If the {@code CompositeSubscription} <em>is</em>
119+
* unsubscribed, {@code add} will indicate this by explicitly unsubscribing the new {@code Subscription} as
120+
* well.
121+
*
122+
* @param s
123+
* the {@link Subscription} to add
118124
*/
119125
public void add(final Subscription s) {
120126
State oldState;
@@ -131,7 +137,11 @@ public void add(final Subscription s) {
131137
}
132138

133139
/**
134-
* @warn javadoc missing
140+
* Removes a {@link Subscription} from this {@code CompositeSubscription}, and unsubscribes the
141+
* {@link Subscription}.
142+
*
143+
* @param s
144+
* the {@link Subscription} to remove
135145
*/
136146
public void remove(final Subscription s) {
137147
State oldState;
@@ -149,7 +159,9 @@ public void remove(final Subscription s) {
149159
}
150160

151161
/**
152-
* @warn javadoc missing
162+
* Unsubscribes any subscriptions that are currently part of this {@code CompositeSubscription} and remove
163+
* them from the {@code CompositeSubscription} so that the {@code CompositeSubscription} is empty and in
164+
* an unoperative state.
153165
*/
154166
public void clear() {
155167
State oldState;

rxjava-core/src/main/java/rx/subscriptions/MultipleAssignmentSubscription.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public void unsubscribe() {
7373

7474
/**
7575
* @warn javadoc missing
76+
* @param s
77+
* @throws IllegalArgumentException
7678
*/
7779
public void set(Subscription s) {
7880
if (s == null) {

0 commit comments

Comments
 (0)