Skip to content

Commit 9563a1b

Browse files
author
jmhofer
committed
Fixed scheduler javadoc, and one single unnecessary cast in takeWhile
1 parent b7cb10b commit 9563a1b

File tree

2 files changed

+37
-20
lines changed

2 files changed

+37
-20
lines changed

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

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,16 @@ public abstract class Scheduler {
7777
* This default implementation schedules recursively and waits for actions to complete (instead of potentially executing
7878
* long-running actions concurrently). Each scheduler that can do periodic scheduling in a better way should override this.
7979
*
80-
* @param state State to pass into the action.
81-
* @param action The action to execute periodically.
82-
* @param initialDelay Time to wait before executing the action for the first time.
83-
* @param period The time interval to wait each time in between executing the action.
84-
* @param unit The time unit the interval above is given in.
80+
* @param state
81+
* State to pass into the action.
82+
* @param action
83+
* The action to execute periodically.
84+
* @param initialDelay
85+
* Time to wait before executing the action for the first time.
86+
* @param period
87+
* The time interval to wait each time in between executing the action.
88+
* @param unit
89+
* The time unit the interval above is given in.
8590
* @return A subscription to be able to unsubscribe from action.
8691
*/
8792
public <T> Subscription schedulePeriodically(T state, final Func2<Scheduler, T, Subscription> action, long initialDelay, long period, TimeUnit unit) {
@@ -249,10 +254,14 @@ public Subscription call(@SuppressWarnings("unused") Scheduler scheduler, @Suppr
249254
/**
250255
* Schedules a cancelable action to be executed periodically.
251256
*
252-
* @param action The action to execute periodically.
253-
* @param initialDelay Time to wait before executing the action for the first time.
254-
* @param period The time interval to wait each time in between executing the action.
255-
* @param unit The time unit the interval above is given in.
257+
* @param action
258+
* The action to execute periodically.
259+
* @param initialDelay
260+
* Time to wait before executing the action for the first time.
261+
* @param period
262+
* The time interval to wait each time in between executing the action.
263+
* @param unit
264+
* The time unit the interval above is given in.
256265
* @return A subscription to be able to unsubscribe from action.
257266
*/
258267
public Subscription schedulePeriodically(final Func1<Scheduler, Subscription> action, long initialDelay, long period, TimeUnit unit) {
@@ -267,10 +276,14 @@ public Subscription call(Scheduler scheduler, @SuppressWarnings("unused") Void s
267276
/**
268277
* Schedules a cancelable action to be executed periodically.
269278
*
270-
* @param action The action to execute periodically.
271-
* @param initialDelay Time to wait before executing the action for the first time.
272-
* @param period The time interval to wait each time in between executing the action.
273-
* @param unit The time unit the interval above is given in.
279+
* @param action
280+
* The action to execute periodically.
281+
* @param initialDelay
282+
* Time to wait before executing the action for the first time.
283+
* @param period
284+
* The time interval to wait each time in between executing the action.
285+
* @param unit
286+
* The time unit the interval above is given in.
274287
* @return A subscription to be able to unsubscribe from action.
275288
*/
276289
public Subscription schedulePeriodically(final Func0<Subscription> action, long initialDelay, long period, TimeUnit unit) {
@@ -285,10 +298,14 @@ public Subscription call(@SuppressWarnings("unused") Scheduler scheduler, @Suppr
285298
/**
286299
* Schedules an action to be executed periodically.
287300
*
288-
* @param action The action to execute periodically.
289-
* @param initialDelay Time to wait before executing the action for the first time.
290-
* @param period The time interval to wait each time in between executing the action.
291-
* @param unit The time unit the interval above is given in.
301+
* @param action
302+
* The action to execute periodically.
303+
* @param initialDelay
304+
* Time to wait before executing the action for the first time.
305+
* @param period
306+
* The time interval to wait each time in between executing the action.
307+
* @param unit
308+
* The time unit the interval above is given in.
292309
* @return A subscription to be able to unsubscribe from action.
293310
*/
294311
public Subscription schedulePeriodically(final Action0 action, long initialDelay, long period, TimeUnit unit) {

rxjava-core/src/main/java/rx/operators/OperationTakeWhile.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import rx.Observer;
2828
import rx.Subscription;
2929
import rx.subjects.PublishSubject;
30+
import rx.subjects.Subject;
3031
import rx.subscriptions.Subscriptions;
3132
import rx.util.AtomicObservableSubscription;
3233
import rx.util.AtomicObserver;
@@ -174,9 +175,8 @@ public Boolean call(Integer input)
174175

175176
@Test
176177
public void testTakeWhileOnSubject1() {
177-
PublishSubject<Integer> s = PublishSubject.create();
178-
Observable<Integer> w = (Observable<Integer>) s;
179-
Observable<Integer> take = Observable.create(takeWhile(w, new Func1<Integer, Boolean>()
178+
Subject<Integer, Integer> s = PublishSubject.create();
179+
Observable<Integer> take = Observable.create(takeWhile(s, new Func1<Integer, Boolean>()
180180
{
181181
@Override
182182
public Boolean call(Integer input)

0 commit comments

Comments
 (0)