32
32
* Extension of {@link Observable} that provides blocking operators.
33
33
* <p>
34
34
* Constructud via {@link #from(Observable)} or {@link Observable#toBlockingObservable()}
35
+ * <p>
36
+ * The documentation for this interface makes use of a form of marble diagram that has been
37
+ * modified to illustrate blocking operators. The following legend explains marble diagrams:
38
+ * <p>
39
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/legend.png">
40
+ * <p>
41
+ * For more information see the <a href="https://github.com/Netflix/RxJava/wiki/Observable">RxJava Wiki</a>
35
42
*
36
43
* @param <T>
37
44
*/
@@ -49,6 +56,8 @@ public Subscription call(Observer<T> observer) {
49
56
50
57
/**
51
58
* Returns an iterator that iterates all values of the observable.
59
+ * <p>
60
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.toIterator.png">
52
61
*
53
62
* @param source
54
63
* an observable sequence to get an iterator for.
@@ -62,6 +71,8 @@ public static <T> Iterator<T> toIterator(Observable<T> source) {
62
71
63
72
/**
64
73
* Returns the last element of an observable sequence with a specified source.
74
+ * <p>
75
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.last.png">
65
76
*
66
77
* @param source
67
78
* the source Observable
@@ -156,6 +167,8 @@ public Boolean call(T args) {
156
167
157
168
/**
158
169
* Samples the most recent value in an observable sequence.
170
+ * <p>
171
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.mostRecent.png">
159
172
*
160
173
* @param source
161
174
* the source observable sequence.
@@ -171,6 +184,8 @@ public static <T> Iterable<T> mostRecent(Observable<T> source, T initialValue) {
171
184
172
185
/**
173
186
* Samples the next value (blocking without buffering) from in an observable sequence.
187
+ * <p>
188
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.next.png">
174
189
*
175
190
* @param items
176
191
* the source observable sequence.
@@ -203,6 +218,8 @@ private static <T> T _singleOrDefault(BlockingObservable<T> source, boolean hasD
203
218
204
219
/**
205
220
* Returns the only element of an observable sequence and throws an exception if there is not exactly one element in the observable sequence.
221
+ * <p>
222
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.single.png">
206
223
*
207
224
* @param source
208
225
* the source Observable
@@ -302,6 +319,8 @@ public static <T> Future<T> toFuture(final Observable<T> source) {
302
319
303
320
/**
304
321
* Converts an observable sequence to an Iterable.
322
+ * <p>
323
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.toIterable.png">
305
324
*
306
325
* @param source
307
326
* the source Observable
@@ -331,6 +350,8 @@ private Subscription protectivelyWrapAndSubscribe(Observer<T> o) {
331
350
* NOTE: This will block even if the Observable is asynchronous.
332
351
* <p>
333
352
* This is similar to {@link #subscribe(Observer)} but blocks. Because it blocks it does not need the {@link Observer#onCompleted()} or {@link Observer#onError(Exception)} methods.
353
+ * <p>
354
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.forEach.png">
334
355
*
335
356
* @param onNext
336
357
* {@link Action1}
@@ -395,6 +416,8 @@ public void onNext(T args) {
395
416
* NOTE: This will block even if the Observable is asynchronous.
396
417
* <p>
397
418
* This is similar to {@link #subscribe(Observer)} but blocks. Because it blocks it does not need the {@link Observer#onCompleted()} or {@link Observer#onError(Exception)} methods.
419
+ * <p>
420
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.forEach.png">
398
421
*
399
422
* @param o
400
423
* onNext {@link Action1 action}
@@ -426,6 +449,8 @@ public void call(Object args) {
426
449
427
450
/**
428
451
* Returns an iterator that iterates all values of the observable.
452
+ * <p>
453
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.getIterator.png">
429
454
*
430
455
* @return the iterator that could be used to iterate over the elements of the observable.
431
456
*/
@@ -435,6 +460,8 @@ public Iterator<T> getIterator() {
435
460
436
461
/**
437
462
* Returns the last element of an observable sequence with a specified source.
463
+ * <p>
464
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.last.png">
438
465
*
439
466
* @return the last element in the observable sequence.
440
467
*/
@@ -527,6 +554,8 @@ public T lastOrDefault(T defaultValue, Object predicate) {
527
554
528
555
/**
529
556
* Samples the most recent value in an observable sequence.
557
+ * <p>
558
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.mostRecent.png">
530
559
*
531
560
* @param initialValue
532
561
* the initial value that will be yielded by the enumerable sequence if no element has been sampled yet.
@@ -538,6 +567,8 @@ public Iterable<T> mostRecent(T initialValue) {
538
567
539
568
/**
540
569
* Samples the next value (blocking without buffering) from in an observable sequence.
570
+ * <p>
571
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.next.png">
541
572
*
542
573
* @return iterable that blocks upon each iteration until the next element in the observable source sequence becomes available.
543
574
*/
@@ -547,6 +578,8 @@ public Iterable<T> next() {
547
578
548
579
/**
549
580
* Returns the only element of an observable sequence and throws an exception if there is not exactly one element in the observable sequence.
581
+ * <p>
582
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.single.png">
550
583
*
551
584
* @return The single element in the observable sequence.
552
585
*/
@@ -642,6 +675,8 @@ public Future<T> toFuture() {
642
675
643
676
/**
644
677
* Converts an observable sequence to an Iterable.
678
+ * <p>
679
+ * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.toIterable.png">
645
680
*
646
681
* @return Observable converted to Iterable.
647
682
*/
0 commit comments