diff --git a/rxjava-core/src/main/java/rx/Observable.java b/rxjava-core/src/main/java/rx/Observable.java index b33e33136c..5d98df26b9 100644 --- a/rxjava-core/src/main/java/rx/Observable.java +++ b/rxjava-core/src/main/java/rx/Observable.java @@ -532,13 +532,14 @@ public ConnectableObservable multicast(Subject su * produced by multicasting the source sequence within a selector function. * * @param subjectFactory the subject factory - * @param selector The selector function which can use the multicasted + * @param selector the selector function which can use the multicasted * source sequence subject to the policies enforced by the - * created subject. + * created subject * @return the Observable sequence that contains the elements of a sequence - * produced by multicasting the source sequence within a selector function. - * - * @see MSDN: Observable.Multicast + * produced by multicasting the source sequence within a selector + * function + * @see RxJava: Observable.publish() and Observable.multicast() + * @see MSDN: Observable.Multicast */ public Observable multicast( final Func0> subjectFactory, @@ -2044,31 +2045,44 @@ public static Observable timer(long delay, TimeUnit unit, Scheduler schedu } /** - * Return an Observable which emits a 0L after the initialDelay and ever increasing - * numbers after each period. + * Return an Observable which emits a 0L after the {@code initialDelay} and + * ever increasing numbers after each {@code period}. + *

+ * * - * @param initialDelay the initial delay time to wait before emitting the first value of 0L + * @param initialDelay the initial delay time to wait before emitting the + * first value of 0L * @param period the time period after emitting the subsequent numbers - * @param unit the time unit for both initialDelay and period - * @return an Observable which emits a 0L after the initialDelay and ever increasing - * numbers after each period - * @see MSDN: Observable.Timer + * @param unit the time unit for both initialDelay and + * period + * @return an Observable which emits a 0L after the {@code initialDelay} and + * ever increasing numbers after each {@code period} + * @see RxJava Wiki: timer() + * @see MSDN: Observable.Timer */ public static Observable timer(long initialDelay, long period, TimeUnit unit) { return timer(initialDelay, period, unit, Schedulers.threadPoolForComputation()); } /** - * Return an Observable which emits a 0L after the initialDelay and ever increasing - * numbers after each period while running on the given scheduler. + * Return an Observable which emits a 0L after the {@code initialDelay} and + * ever increasing numbers after each {@code period} while running on the + * given {@code scheduler}. + *

+ * * - * @param initialDelay the initial delay time to wait before emitting the first value of 0L + * @param initialDelay the initial delay time to wait before emitting the + * first value of 0L * @param period the time period after emitting the subsequent numbers - * @param unit the time unit for both initialDelay and period - * @param scheduler the scheduler where the waiting happens and value emissions run. - * @return an Observable which emits a 0L after the initialDelay and ever increasing - * numbers after each period while running on the given scheduler - * @see MSDN: Observable.Timer + * @param unit the time unit for both initialDelay and + * period + * @param scheduler the scheduler on which the waiting happens and value + * emissions run + * @return an Observable that emits a 0L after the {@code initialDelay} and + * ever increasing numbers after each {@code period} while running + * on the given {@code scheduler} + * @see RxJava Wiki: timer() + * @see MSDN: Observable.Timer */ public static Observable timer(long initialDelay, long period, TimeUnit unit, Scheduler scheduler) { return create(new OperationTimer.TimerPeriodically(initialDelay, period, unit, scheduler)); @@ -4332,27 +4346,35 @@ public ConnectableObservable replay() { * Returns a {@link ConnectableObservable} that shares a single subscription * to the underlying Observable that will replay all of its items and * notifications to any future {@link Observer} on the given scheduler. + *

+ * * - * @param scheduler the scheduler where the Observers will receive the events + * @param scheduler the scheduler on which the Observers will observe the + * emitted items * @return a {@link ConnectableObservable} that shares a single subscription - * to the underlying Observable that will replay all of its items and - * notifications to any future {@link Observer} on the given scheduler - * - * @see MSDN: Observable.Replay + * to the source Observable that will replay all of its items and + * notifications to any future {@link Observer} on the given + * scheduler + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public ConnectableObservable replay(Scheduler scheduler) { return OperationMulticast.multicast(this, OperationReplay.createScheduledSubject(ReplaySubject.create(), scheduler)); } /** - * Returns a connectable observable sequence that shares a single subscription - * to the underlying sequence replaying bufferSize notifications. + * Returns a connectable observable sequence that shares a single + * subscription to the source Observable that replays at most + * {@code bufferSize} items emitted by that Observable. + *

+ * * * @param bufferSize the buffer size - * @return a connectable observable sequence that shares a single subscription - * to the underlying sequence replaying bufferSize notifications - * - * @see MSDN: Observable.Replay + * @return a connectable observable sequence that shares a single + * subscription to the source Observable and replays at most + * {@code bufferSize} items emitted by that Observable + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public ConnectableObservable replay(int bufferSize) { return OperationMulticast.multicast(this, OperationReplay.replayBuffered(bufferSize)); @@ -4360,14 +4382,19 @@ public ConnectableObservable replay(int bufferSize) { /** * Returns a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications. + * subscription to the source Observable and replays at most + * {@code bufferSize} items emitted by that Observable. + *

+ * * * @param bufferSize the buffer size - * @param scheduler the scheduler where the Observers will receive the events + * @param scheduler the scheduler on which the Observers will observe the + * emitted items * @return a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications - * - * @see MSDN: Observable.Replay + * subscription to the source Observable and replays at most + * {@code bufferSize} items emitted by that Observable + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public ConnectableObservable replay(int bufferSize, Scheduler scheduler) { return OperationMulticast.multicast(this, @@ -4377,13 +4404,19 @@ public ConnectableObservable replay(int bufferSize, Scheduler scheduler) { /** * Returns a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying all notifications within window. + * subscription to the source Observable and replays all items emitted by + * that Observable within a time window. + *

+ * * * @param time the window length * @param unit the window length time unit * @return a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying all notifications within window - * @see MSDN: Observable.Replay + * subscription to the source Observable and that replays all items + * emitted by that Observable during the window defined by + * {@code time} and {@code unit} + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public ConnectableObservable replay(long time, TimeUnit unit) { return replay(time, unit, Schedulers.threadPoolForComputation()); @@ -4391,14 +4424,21 @@ public ConnectableObservable replay(long time, TimeUnit unit) { /** * Returns a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying all notifications within window. + * subscription to the source Observable and replays all items emitted by + * that Observable within a time window. + *

+ * * * @param time the window length * @param unit the window length time unit - * @param scheduler the scheduler which is used as a time source for the window + * @param scheduler the scheduler that is used as a time source for the + * window * @return a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying all notifications within window - * @see MSDN: Observable.Replay + * subscription to the source Observable and replays all items + * emitted by that Observable within the window defined by + * {@code time} and {@code unit} + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public ConnectableObservable replay(long time, TimeUnit unit, Scheduler scheduler) { return OperationMulticast.multicast(this, OperationReplay.replayWindowed(time, unit, -1, scheduler)); @@ -4406,15 +4446,18 @@ public ConnectableObservable replay(long time, TimeUnit unit, Scheduler sched /** * Returns a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications within window. + * subscription to the underlying sequence replaying {@code bufferSize} + * notifications within window. + *

+ * * * @param bufferSize the buffer size * @param time the window length * @param unit the window length time unit * @return Returns a connectable observable sequence that shares a single * subscription to the underlying sequence replaying bufferSize notifications within window - * - * @see MSDN: Observable.Replay + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public ConnectableObservable replay(int bufferSize, long time, TimeUnit unit) { return replay(bufferSize, time, unit, Schedulers.threadPoolForComputation()); @@ -4422,16 +4465,23 @@ public ConnectableObservable replay(int bufferSize, long time, TimeUnit unit) /** * Returns a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications within window. + * subscription to the underlying sequence and that replays a maximum of + * {@code bufferSize} items that are emitted within the window defined by + * {@code time} and {@code unit}. + *

+ * * * @param bufferSize the buffer size * @param time the window length * @param unit the window length time unit - * @param scheduler the scheduler which is used as a time source for the window + * @param scheduler the scheduler that is used as a time source for the + * window * @return a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications within window - * - * @see MSDN: Observable.Replay + * subscription to the underlying sequence that replays a maximum of + * {@code bufferSize} items that are emitted within the window + * defined by {@code time} and {@code unit} + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public ConnectableObservable replay(int bufferSize, long time, TimeUnit unit, Scheduler scheduler) { if (bufferSize < 0) { @@ -4441,19 +4491,20 @@ public ConnectableObservable replay(int bufferSize, long time, TimeUnit unit, } /** - * Returns an observable sequence that is the result of invoking the selector - * on a connectable observable sequence that shares a single subscription to - * the underlying sequence and starts with initial value. + * Returns an observable sequence that is the result of invoking the + * selector on a connectable observable sequence that shares a single + * subscription to the underlying sequence and starts with initial value. * * @param the return element type - * @param selector The selector function which can use the multicasted + * @param selector the selector function which can use the multicasted * this sequence as many times as needed, without causing - * multiple subscriptions to this sequence. - * @return an observable sequence that is the result of invoking the selector - * on a connectable observable sequence that shares a single subscription to - * the underlying sequence and starts with initial value - * - * @see MSDN: Observable.Replay + * multiple subscriptions to this sequence + * @return an observable sequence that is the result of invoking the + * selector on a connectable observable sequence that shares a + * single subscription to the underlying sequence and starts with + * initial value + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public Observable replay(Func1, ? extends Observable> selector) { return OperationMulticast.multicast(this, new Func0>() { @@ -4470,15 +4521,16 @@ public Subject call() { * subscription to the underlying sequence replaying all notifications. * * @param the return element type - * @param selector The selector function which can use the multicasted + * @param selector the selector function which can use the multicasted * this sequence as many times as needed, without causing - * multiple subscriptions to this sequence. + * multiple subscriptions to this sequence * @param scheduler the scheduler where the replay is observed * @return an observable sequence that is the result of invoking the - * selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying all notifications - * - * @see MSDN: Observable.Replay + * selector on a connectable observable sequence that shares a + * single subscription to the underlying sequence replaying all + * notifications + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public Observable replay(Func1, ? extends Observable> selector, final Scheduler scheduler) { return OperationMulticast.multicast(this, new Func0>() { @@ -4492,18 +4544,20 @@ public Subject call() { /** * Returns an observable sequence that is the result of invoking the * selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications. + * subscription to the underlying sequence replaying {@code bufferSize} + * notifications. * * @param the return element type - * @param selector The selector function which can use the multicasted + * @param selector the selector function which can use the multicasted * this sequence as many times as needed, without causing - * multiple subscriptions to this sequence. + * multiple subscriptions to this sequence * @param bufferSize the buffer size * @return an observable sequence that is the result of invoking the - * selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications - * - * @see MSDN: Observable.Replay + * selector on a connectable observable sequence that shares a + * single subscription to the underlying sequence replaying + * {@code bufferSize} notifications + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public Observable replay(Func1, ? extends Observable> selector, final int bufferSize) { return OperationMulticast.multicast(this, new Func0>() { @@ -4517,19 +4571,21 @@ public Subject call() { /** * Returns an observable sequence that is the result of invoking the * selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications. + * subscription to the underlying sequence replaying {@code bufferSize} + * notifications. * * @param the return element type - * @param selector The selector function which can use the multicasted + * @param selector the selector function which can use the multicasted * this sequence as many times as needed, without causing - * multiple subscriptions to this sequence. + * multiple subscriptions to this sequence * @param bufferSize the buffer size * @param scheduler the scheduler where the replay is observed * @return an observable sequence that is the result of invoking the - * selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications - * - * @see MSDN: Observable.Replay + * selector on a connectable observable sequence that shares a + * single subscription to the underlying sequence replaying + * {@code bufferSize} notifications + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public Observable replay(Func1, ? extends Observable> selector, final int bufferSize, final Scheduler scheduler) { return OperationMulticast.multicast(this, new Func0>() { @@ -4541,21 +4597,23 @@ public Subject call() { } /** - * Returns an observable sequence that is the result of invoking - * the selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying all notifications within window. + * Returns an observable sequence that is the result of invoking the + * selector on a connectable observable sequence that shares a single + * subscription to the underlying sequence replaying all notifications + * within window. * * @param the return element type - * @param selector The selector function which can use the multicasted + * @param selector the selector function which can use the multicasted * this sequence as many times as needed, without causing - * multiple subscriptions to this sequence. + * multiple subscriptions to this sequence * @param time the window length * @param unit the window length time unit - * @return an observable sequence that is the result of invoking - * the selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying all notifications within window - * - * @see MSDN: Observable.Replay + * @return an observable sequence that is the result of invoking the + * selector on a connectable observable sequence that shares a + * single subscription to the underlying sequence replaying all + * notifications within window + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public Observable replay(Func1, ? extends Observable> selector, long time, TimeUnit unit) { return replay(selector, time, unit, Schedulers.threadPoolForComputation()); @@ -4564,20 +4622,23 @@ public Observable replay(Func1, ? extends Observabl /** * Returns an observable sequence that is the result of invoking the * selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying all notifications within window. + * subscription to the underlying sequence replaying all notifications + * within window. * * @param the return element type - * @param selector The selector function which can use the multicasted + * @param selector the selector function which can use the multicasted * this sequence as many times as needed, without causing - * multiple subscriptions to this sequence. + * multiple subscriptions to this sequence * @param time the window length * @param unit the window length time unit - * @param scheduler the scheduler which is used as a time source for the window + * @param scheduler the scheduler that is used as a time source for the + * window * @return an observable sequence that is the result of invoking the - * selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying all notifications within window - * - * @see MSDN: Observable.Replay + * selector on a connectable observable sequence that shares a + * single subscription to the underlying sequence replaying all + * notifications within window + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public Observable replay(Func1, ? extends Observable> selector, final long time, final TimeUnit unit, final Scheduler scheduler) { return OperationMulticast.multicast(this, new Func0>() { @@ -4591,23 +4652,22 @@ public Subject call() { /** * Returns an observable sequence that is the result of invoking the * selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications - * within window. + * subscription to the underlying sequence replaying {@code bufferSize} + * notifications within window. * * @param the return element type - * @param selector The selector function which can use the multicasted + * @param selector the selector function which can use the multicasted * this sequence as many times as needed, without causing - * multiple subscriptions to this sequence. + * multiple subscriptions to this sequence * @param bufferSize the buffer size * @param time the window length * @param unit the window length time unit - * * @return an observable sequence that is the result of invoking the - * selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications - * within window - * - * @see MSDN: Observable.Replay + * selector on a connectable observable sequence that shares a + * single subscription to the underlying sequence replaying + * {@code bufferSize} notifications within window + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public Observable replay(Func1, ? extends Observable> selector, int bufferSize, long time, TimeUnit unit) { return replay(selector, bufferSize, time, unit, Schedulers.threadPoolForComputation()); @@ -4617,24 +4677,24 @@ public Observable replay(Func1, ? extends Observabl /** * Returns an observable sequence that is the result of invoking the * selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications - * within window. + * subscription to the underlying sequence replaying {@code bufferSize} + * notifications within window. * * @param the return element type - * @param selector The selector function which can use the multicasted + * @param selector the selector function which can use the multicasted * this sequence as many times as needed, without causing - * multiple subscriptions to this sequence. + * multiple subscriptions to this sequence * @param bufferSize the buffer size * @param time the window length * @param unit the window length time unit - * @param scheduler the scheduler which is used as a time source for the window - * + * @param scheduler the scheduler which is used as a time source for the + * window * @return an observable sequence that is the result of invoking the - * selector on a connectable observable sequence that shares a single - * subscription to the underlying sequence replaying bufferSize notifications - * within window - * - * @see MSDN: Observable.Replay + * selector on a connectable observable sequence that shares a + * single subscription to the underlying sequence replaying + * {@code bufferSize} notifications within window + * @see RxJava Wiki: replay() + * @see MSDN: Observable.Replay */ public Observable replay(Func1, ? extends Observable> selector, final int bufferSize, final long time, final TimeUnit unit, final Scheduler scheduler) { if (bufferSize < 0) {