From ed162767439add7547a66d8cf38d591a92f2e3f6 Mon Sep 17 00:00:00 2001 From: "David M. Gross" Date: Tue, 28 May 2013 11:53:02 -0700 Subject: [PATCH] adding several marble diagrams several new marble diagrams for previously undiagrammed methods --- rxjava-core/src/main/java/rx/Observable.java | 94 +++++++++++++++++++- 1 file changed, 92 insertions(+), 2 deletions(-) diff --git a/rxjava-core/src/main/java/rx/Observable.java b/rxjava-core/src/main/java/rx/Observable.java index e824b0f210..cca064e39a 100644 --- a/rxjava-core/src/main/java/rx/Observable.java +++ b/rxjava-core/src/main/java/rx/Observable.java @@ -218,7 +218,6 @@ public Subscription subscribe(Observer observer) { *

* For more information see the RxJava Wiki * - * * @param observer * @param scheduler * The {@link Scheduler} that the sequence is subscribed to on. @@ -594,6 +593,8 @@ public Subscription call(Observer observer) { /** * Creates an Observable that will execute the given function when a {@link Observer} subscribes to it. *

+ * + *

* Write the function you pass to create so that it behaves as an Observable - calling the passed-in * onNext, onError, and onCompleted methods appropriately. *

@@ -615,6 +616,8 @@ public static Observable create(Func1, Subscription> func) { /** * Creates an Observable that will execute the given function when a {@link Observer} subscribes to it. *

+ * + *

* This method accept {@link Object} to allow different languages to pass in closures using {@link FunctionLanguageAdaptor}. *

* Write the function you pass to create so that it behaves as an Observable - calling the passed-in @@ -660,6 +663,7 @@ public static Observable empty() { /** * Returns an Observable that calls onError when an {@link Observer} subscribes to it. *

+ * * * @param exception * the error to throw @@ -728,6 +732,8 @@ public static Observable where(Observable that, Func1 pred /** * Converts an {@link Iterable} sequence to an Observable sequence. + *

+ * * * @param iterable * the source {@link Iterable} sequence @@ -742,6 +748,8 @@ public static Observable from(Iterable iterable) { /** * Converts an Array to an Observable sequence. + *

+ * * * @param items * the source Array @@ -756,6 +764,8 @@ public static Observable from(T... items) { /** * Generates an observable sequence of integral numbers within a specified range. + *

+ * * * @param start * The value of the first integer in the sequence @@ -772,6 +782,8 @@ public static Observable range(int start, int count) { /** * Asynchronously subscribes and unsubscribes observers on the specified scheduler. + *

+ * * * @param source * the source observable. @@ -787,6 +799,8 @@ public static Observable subscribeOn(Observable source, Scheduler sche /** * Asynchronously notify observers on the specified scheduler. + *

+ * * * @param source * the source observable. @@ -999,6 +1013,8 @@ public static Observable> materialize(final Observable se /** * Dematerializes the explicit notification values of an observable sequence as implicit notifications. + *

+ * * * @param sequence * An observable sequence containing explicit notification values which have to be turned into implicit notifications. @@ -1062,6 +1078,8 @@ public static Observable merge(Observable... source) { /** * Returns the values from the source observable sequence until the other observable sequence produces a value. + *

+ * * * @param source * the source sequence to propagate elements for. @@ -1096,6 +1114,8 @@ public static Observable concat(Observable... source) { /** * Emits the same objects as the given Observable, calling the given action * when it calls onComplete or onError. + *

+ * * * @param source * an observable @@ -1166,6 +1186,8 @@ public static Observable flatMap(Observable sequence, final Object /** * Groups the elements of an observable and selects the resulting elements by using a specified function. + *

+ * * * @param source * an observable whose elements to group. @@ -1187,6 +1209,8 @@ public static Observable> groupBy(Observable + * * * @param source * an observable whose elements to group. @@ -1261,7 +1285,9 @@ public static Observable mergeDelayError(Observable... source) { /** * Returns an Observable that never sends any information to an {@link Observer}. - * + *

+ * + *

* This observable is useful primarily for testing purposes. * * @param @@ -1376,6 +1402,8 @@ public static Observable onErrorResumeNext(final Observable that, fina * onError function, it will instead pass the return value of resumeFunction to the {@link Observer}'s onNext method. *

* You can use this to prevent errors from propagating or to supply fallback data should errors be encountered. + *

+ * * * @param that * the source Observable @@ -1408,6 +1436,8 @@ public static ConnectableObservable replay(final Observable that) { * NOTE: You sacrifice the ability to unsubscribe from the origin with this operator so be careful to not * use this on infinite or very large sequences that will use up memory. This is similar to * the {@link Observable#toList()} operator in this caution. + *

+ * * * @return an observable sequence that upon first subscription caches all events for subsequent subscriptions. */ @@ -1417,6 +1447,8 @@ public static Observable cache(final Observable that) { /** * Returns a connectable observable sequence that shares a single subscription to the underlying sequence. + *

+ * * * @param that * the source Observable @@ -1647,6 +1679,8 @@ public R call(R r, T t) { /** * Determines whether all elements of an observable sequence satisfies a condition. + *

+ * * * @param sequence * an observable sequence whose elements to apply the predicate to. @@ -1662,6 +1696,8 @@ public static Observable all(final Observable sequence, final Fu /** * Determines whether all elements of an observable sequence satisfies a condition. + *

+ * * * @param sequence * an observable sequence whose elements to apply the predicate to. @@ -1705,6 +1741,8 @@ public static Observable skip(final Observable items, int num) { /** * Accepts an {@link Observable} sequence of {@link Observable} sequences, and transforms it into a single * {@link Observable} sequence, which publishes the values of the most recently published {@link Observable} sequence. + *

+ * * * @param sequenceOfSequences * the {@link Observable} sequence of {@link Observable} sequences. @@ -1722,6 +1760,8 @@ public static Observable switchDo(Observable> sequenceOfSeq * A well-behaved observable ensures onNext, onCompleted, or onError calls to its subscribers are not interleaved, onCompleted and * onError are only called once respectively, and no * onNext calls follow onCompleted and onError calls. + *

+ * * * @param observable * the source Observable @@ -1758,6 +1798,8 @@ public static Observable take(final Observable items, final int num) { /** * Returns an Observable that emits the last count items emitted by the source * Observable. + *

+ * * * @param items * the source Observable @@ -1773,6 +1815,8 @@ public static Observable takeLast(final Observable items, final int co /** * Returns the values from the start of an observable sequence while a given predicate remains true. + *

+ * * * @param items * @param predicate @@ -1785,6 +1829,8 @@ public static Observable takeWhile(final Observable items, Func1 + * * * @param items * @param predicate @@ -1831,6 +1877,8 @@ public Boolean call(T t, Integer integer) /** * Adds a timestamp to each item emitted by this observable. + *

+ * * * @return An observable sequence of timestamped items. */ @@ -2084,6 +2132,8 @@ public static Observable zip(Observable w0, Observable w1 /** * Determines whether two sequences are equal by comparing the elements pairwise. + *

+ * * * @param first * observable to compare @@ -2104,6 +2154,8 @@ public Boolean call(T first, T second) { /** * Determines whether two sequences are equal by comparing the elements pairwise using a specified equality function. + *

+ * * * @param first * observable sequence to compare @@ -2121,6 +2173,8 @@ public static Observable sequenceEqual(Observable first, Observa /** * Determines whether two sequences are equal by comparing the elements pairwise using a specified equality function. + *

+ * * * @param first * observable sequence to compare @@ -2342,6 +2396,8 @@ public Observable filter(Func1 predicate) { /** * Registers an action to be called when this observable calls * onComplete or onError. + *

+ * * * @param action * an action to be called when this observable completes or errors. @@ -2536,6 +2592,8 @@ public Observable> materialize() { /** * Asynchronously subscribes and unsubscribes observers on the specified scheduler. + *

+ * * * @param scheduler * the scheduler to perform subscription and unsubscription actions on. @@ -2547,6 +2605,8 @@ public Observable subscribeOn(Scheduler scheduler) { /** * Asynchronously notify observers on the specified scheduler. + *

+ * * * @param scheduler * the scheduler to notify observers on. @@ -2558,6 +2618,8 @@ public Observable observeOn(Scheduler scheduler) { /** * Dematerializes the explicit notification values of an observable sequence as implicit notifications. + *

+ * * * @return An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. * @see MSDN: Observable.dematerialize @@ -2673,6 +2735,8 @@ public Observable onErrorResumeNext(final Observable resumeSequence) { *

* You can use this to prevent errors from propagating or to supply fallback data should errors * be encountered. + *

+ * * * @param resumeFunction * @return the original Observable with appropriately modified behavior @@ -2696,6 +2760,8 @@ public Observable onErrorReturn(Func1 resumeFunction) { *

* You can use this to prevent errors from propagating or to supply fallback data should errors * be encountered. + *

+ * * * @param resumeFunction * @return the original Observable with appropriately modified behavior @@ -2757,6 +2823,8 @@ public ConnectableObservable replay() { * NOTE: You sacrifice the ability to unsubscribe from the origin with this operator so be careful to not * use this on infinite or very large sequences that will use up memory. This is similar to * the {@link Observable#toList()} operator in this caution. + *

+ * * * @return an observable sequence that upon first subscription caches all events for subsequent subscriptions. */ @@ -2766,6 +2834,8 @@ public Observable cache() { /** * Returns a connectable observable sequence that shares a single subscription to the underlying sequence. + *

+ * * * @return a connectable observable sequence that upon connection causes the source sequence to push results into the specified subject. */ @@ -2875,6 +2945,8 @@ public Observable scan(Func2 accumulator) { /** * Samples the observable sequence at each interval. + *

+ * * * @param period * The period of time that defines the sampling rate. @@ -2888,6 +2960,8 @@ public Observable sample(long period, TimeUnit unit) { /** * Samples the observable sequence at each interval. + *

+ * * * @param period * The period of time that defines the sampling rate. @@ -2944,6 +3018,8 @@ public Observable scan(final R initialValue, final Object accumulator) { /** * Determines whether all elements of an observable sequence satisfies a condition. + *

+ * * * @param predicate * a function to test each element for a condition. @@ -2955,6 +3031,8 @@ public Observable all(Func1 predicate) { /** * Determines whether all elements of an observable sequence satisfies a condition. + *

+ * * * @param predicate * a function to test each element for a condition. @@ -3003,6 +3081,8 @@ public Observable take(final int num) { /** * Returns an Observable that items emitted by the source Observable as long as a specified condition is true. + *

+ * * * @param predicate * a function to test each source element for a condition @@ -3014,6 +3094,8 @@ public Observable takeWhile(final Func1 predicate) { /** * Returns an Observable that items emitted by the source Observable as long as a specified condition is true. + *

+ * * * @param predicate * a function to test each source element for a condition @@ -3048,6 +3130,8 @@ public Observable takeWhileWithIndex(final Object predicate) { /** * Returns an Observable that emits the last count items emitted by the source * Observable. + *

+ * * * @param count * the number of items from the end of the sequence emitted by the source @@ -3061,6 +3145,8 @@ public Observable takeLast(final int count) { /** * Returns the values from the source observable sequence until the other observable sequence produces a value. + *

+ * * * @param other * the observable sequence that terminates propagation of elements of the source sequence. @@ -3136,6 +3222,8 @@ public Observable startWith(T... values) { /** * Groups the elements of an observable and selects the resulting elements by using a specified function. + *

+ * * * @param keySelector * a function to extract the key for each element. @@ -3153,6 +3241,8 @@ public Observable> groupBy(final Func1 keyS /** * Groups the elements of an observable according to a specified key selector function and + *

+ * * * @param keySelector * a function to extract the key for each element.