Skip to content

Commit 00ca382

Browse files
committed
Updates some javadoc comments to reflect 0.17 changes
1 parent 267d569 commit 00ca382

File tree

1 file changed

+28
-59
lines changed

1 file changed

+28
-59
lines changed

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

Lines changed: 28 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ public class Observable<T> {
162162
/**
163163
* Observable with Function to execute when subscribed to.
164164
* <p>
165-
* <em>Note:</em> Use {@link #create(OnSubscribeFunc)} to create an Observable, instead of this
165+
* <em>Note:</em> Use {@link #create(OnSubscribe)} to create an Observable, instead of this
166166
* constructor, unless you specifically have a need for inheritance.
167167
*
168-
* @param onSubscribe
169-
* {@link OnSubscribeFunc} to be executed when {@link #subscribe(Subscriber)} is called
168+
* @param f
169+
* {@link OnSubscribe} to be executed when {@link #subscribe(Subscriber)} is called
170170
*/
171171
protected Observable(OnSubscribe<T> f) {
172172
this.f = f;
@@ -175,25 +175,27 @@ protected Observable(OnSubscribe<T> f) {
175175
private final static RxJavaObservableExecutionHook hook = RxJavaPlugins.getInstance().getObservableExecutionHook();
176176

177177
/**
178-
* Returns an Observable that will execute the specified function when an {@link Subscriber} subscribes to it.
178+
* Returns an Observable that will execute the specified function when a {@link Subscriber}
179+
* subscribes to it.
179180
* <p>
180181
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/create.png">
181182
* <p>
182183
* Write the function you pass to {@code create} so that it behaves as an Observable: It should
183-
* invoke the Observer's {@link Subscriber#onNext onNext}, {@link Subscriber#onError onError}, and {@link Subscriber#onCompleted onCompleted} methods appropriately.
184+
* invoke the Subscriber's {@link Subscriber#onNext onNext}, {@link Subscriber#onError onError},
185+
* and {@link Subscriber#onCompleted onCompleted} methods appropriately.
184186
* <p>
185-
* A well-formed Observable must invoke either the Observer's {@code onCompleted} method
187+
* A well-formed Observable must invoke either the Subscriber's {@code onCompleted} method
186188
* exactly once or its {@code onError} method exactly once.
187189
* <p>
188190
* See <a href="http://go.microsoft.com/fwlink/?LinkID=205219">Rx Design Guidelines (PDF)</a>
189191
* for detailed information.
190192
*
191193
* @param <T>
192194
* the type of the items that this Observable emits
193-
* @param func
194-
* a function that accepts an {@code Observer<T>}, invokes its {@code onNext}, {@code onError}, and {@code onCompleted} methods as appropriate, and returns a {@link Subscription} that
195-
* allows the Observer to cancel the subscription
196-
* @return an Observable that, when an {@link Subscriber} subscribes to it, will execute the
195+
* @param f
196+
* a function that accepts an {@code Subscriber<T>}, and invokes its {@code onNext},
197+
* {@code onError}, and {@code onCompleted} methods as appropriate
198+
* @return an Observable that, when a {@link Subscriber} subscribes to it, will execute the
197199
* specified function
198200
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#wiki-create">RxJava Wiki: create()</a>
199201
* @see <a href="http://msdn.microsoft.com/en-us/library/system.reactive.linq.observable.create.aspx">MSDN: Observable.Create</a>
@@ -202,10 +204,16 @@ public final static <T> Observable<T> create(OnSubscribe<T> f) {
202204
return new Observable<T>(f);
203205
}
204206

207+
/**
208+
*
209+
*/
205210
public static interface OnSubscribe<T> extends Action1<Subscriber<? super T>> {
206211

207212
}
208213

214+
/**
215+
*
216+
*/
209217
public final static <T> Observable<T> create(final OnSubscribeFunc<T> f) {
210218
return new Observable<T>(new OnSubscribe<T>() {
211219

@@ -220,6 +228,9 @@ public void call(Subscriber<? super T> observer) {
220228
});
221229
}
222230

231+
/**
232+
*
233+
*/
223234
public static interface OnSubscribeFunc<T> extends Function {
224235

225236
public Subscription onSubscribe(Observer<? super T> op);
@@ -1025,7 +1036,7 @@ public final static <T> Observable<T> concat(Observable<? extends T> t1, Observa
10251036
/**
10261037
* Returns an Observable that calls an Observable factory to create its Observable for each new
10271038
* Observer that subscribes. That is, for each subscriber, the actual Observable that subscriber
1028-
* observs is determined by the factory function.
1039+
* observes is determined by the factory function.
10291040
* <p>
10301041
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/defer.png">
10311042
* <p>
@@ -1194,9 +1205,6 @@ public final static <T> Observable<T> from(Future<? extends T> future, Scheduler
11941205
* sequence.
11951206
* <p>
11961207
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/from.png">
1197-
* <p>
1198-
* Note: the entire iterable sequence is immediately emitted each time an {@link Observer} subscribes. Since this occurs before the {@link Subscription} is returned, it is not possible
1199-
* to unsubscribe from the sequence before it completes.
12001208
*
12011209
* @param iterable
12021210
* the source {@link Iterable} sequence
@@ -1236,10 +1244,6 @@ public final static <T> Observable<T> from(Iterable<? extends T> iterable, Sched
12361244
* Converts an item into an Observable that emits that item.
12371245
* <p>
12381246
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/from.png">
1239-
* <p>
1240-
* Note: the item is immediately emitted each time an {@link Observer} subscribes. Since this
1241-
* occurs before the {@link Subscription} is returned, it is not possible to unsubscribe from
1242-
* the sequence before it completes.
12431247
*
12441248
* @param t1
12451249
* the item
@@ -1257,10 +1261,6 @@ public final static <T> Observable<T> from(T t1) {
12571261
* Converts two items into an Observable that emits those items.
12581262
* <p>
12591263
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/from.png">
1260-
* <p>
1261-
* Note: the items will be immediately emitted each time an {@link Observer} subscribes. Since
1262-
* this occurs before the {@link Subscription} is returned, it is not possible to unsubscribe
1263-
* from the sequence before it completes.
12641264
*
12651265
* @param t1
12661266
* first item
@@ -1282,10 +1282,6 @@ public final static <T> Observable<T> from(T t1, T t2) {
12821282
* Converts three items into an Observable that emits those items.
12831283
* <p>
12841284
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/from.png">
1285-
* <p>
1286-
* Note: the items will be immediately emitted each time an {@link Observer} subscribes. Since
1287-
* this occurs before the {@link Subscription} is returned, it is not possible to unsubscribe
1288-
* from the sequence before it completes.
12891285
*
12901286
* @param t1
12911287
* first item
@@ -1309,10 +1305,6 @@ public final static <T> Observable<T> from(T t1, T t2, T t3) {
13091305
* Converts four items into an Observable that emits those items.
13101306
* <p>
13111307
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/from.png">
1312-
* <p>
1313-
* Note: the items will be immediately emitted each time an {@link Observer} subscribes. Since
1314-
* this occurs before the {@link Subscription} is returned, it is not possible to unsubscribe
1315-
* from the sequence before it completes.
13161308
*
13171309
* @param t1
13181310
* first item
@@ -1338,10 +1330,6 @@ public final static <T> Observable<T> from(T t1, T t2, T t3, T t4) {
13381330
* Converts five items into an Observable that emits those items.
13391331
* <p>
13401332
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/from.png">
1341-
* <p>
1342-
* Note: the items will be immediately emitted each time an {@link Observer} subscribes. Since
1343-
* this occurs before the {@link Subscription} is returned, it is not possible to unsubscribe
1344-
* from the sequence before it completes.
13451333
*
13461334
* @param t1
13471335
* first item
@@ -1369,10 +1357,6 @@ public final static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5) {
13691357
* Converts six items into an Observable that emits those items.
13701358
* <p>
13711359
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/from.png">
1372-
* <p>
1373-
* Note: the items will be immediately emitted each time an {@link Observer} subscribes. Since
1374-
* this occurs before the {@link Subscription} is returned, it is not possible to unsubscribe
1375-
* from the sequence before it completes.
13761360
*
13771361
* @param t1
13781362
* first item
@@ -1402,10 +1386,6 @@ public final static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6) {
14021386
* Converts seven items into an Observable that emits those items.
14031387
* <p>
14041388
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/from.png">
1405-
* <p>
1406-
* Note: the items will be immediately emitted each time an {@link Observer} subscribes. Since
1407-
* this occurs before the {@link Subscription} is returned, it is not possible to unsubscribe
1408-
* from the sequence before it completes.
14091389
*
14101390
* @param t1
14111391
* first item
@@ -1437,10 +1417,6 @@ public final static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6, T
14371417
* Converts eight items into an Observable that emits those items.
14381418
* <p>
14391419
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/from.png">
1440-
* <p>
1441-
* Note: the items will be immediately emitted each time an {@link Observer} subscribes. Since
1442-
* this occurs before the {@link Subscription} is returned, it is not possible to unsubscribe
1443-
* from the sequence before it completes.
14441420
*
14451421
* @param t1
14461422
* first item
@@ -1474,10 +1450,6 @@ public final static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6, T
14741450
* Converts nine items into an Observable that emits those items.
14751451
* <p>
14761452
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/from.png">
1477-
* <p>
1478-
* Note: the items will be immediately emitted each time an {@link Observer} subscribes. Since
1479-
* this occurs before the {@link Subscription} is returned, it is not possible to unsubscribe
1480-
* from the sequence before it completes.
14811453
*
14821454
* @param t1
14831455
* first item
@@ -1551,9 +1523,6 @@ public final static <T> Observable<T> from(T t1, T t2, T t3, T t4, T t5, T t6, T
15511523
* Converts an Array into an Observable that emits the items in the Array.
15521524
* <p>
15531525
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/from.png">
1554-
* <p>
1555-
* <em>Note:</em> the entire array is immediately emitted each time an {@link Observer} subscribes. Since this occurs before the {@link Subscription} is returned, it is not possible
1556-
* to unsubscribe from the sequence before it completes.
15571526
*
15581527
* @param items
15591528
* the source array
@@ -1573,9 +1542,6 @@ public final static <T> Observable<T> from(T... t1) {
15731542
* scheduler.
15741543
* <p>
15751544
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/from.png">
1576-
* <p>
1577-
* <em>Note:</em> the entire array is immediately emitted each time an {@link Observer} subscribes. Since this occurs before the {@link Subscription} is returned, it is not
1578-
* possible to unsubscribe from the sequence before it completes.
15791545
*
15801546
* @param items
15811547
* the source array
@@ -3805,12 +3771,15 @@ public final <B> Observable<List<T>> buffer(Observable<B> boundary, int initialC
38053771
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/cache.png">
38063772
* <p>
38073773
* This is useful when you want an Observable to cache responses and you can't control the
3808-
* subscribe/unsubscribe behavior of all the {@link Observer}s.
3774+
* subscribe/unsubscribe behavior of all the {@link Subscriber}s.
38093775
* <p>
38103776
* When you call {@code cache()}, it does not yet subscribe to the source Observable. This only
3811-
* happens when {@code subscribe} is called the first time on the Observable returned by {@code cache()}.
3777+
* happens when {@code subscribe} is called the first time on the Observable returned by
3778+
* {@code cache()}.
38123779
* <p>
3813-
* <em>Note:</em> You sacrifice the ability to unsubscribe from the origin when you use the {@code cache()} Observer so be careful not to use this Observer on Observables that emit an
3780+
* <!-- IS THIS NOTE STILL VALID??? -->
3781+
* <em>Note:</em> You sacrifice the ability to unsubscribe from the origin when you use the
3782+
* {@code cache()} Observer so be careful not to use this Observer on Observables that emit an
38143783
* infinite or very large number of items that will use up memory.
38153784
*
38163785
* @return an Observable that, when first subscribed to, caches all of its items and

0 commit comments

Comments
 (0)