52
52
import rx .operators .OperationDelay ;
53
53
import rx .operators .OperationGroupByUntil ;
54
54
import rx .operators .OperationGroupJoin ;
55
- import rx .operators .OperationInterval ;
56
55
import rx .operators .OperationJoin ;
57
56
import rx .operators .OperationMergeDelayError ;
58
57
import rx .operators .OperationMergeMaxConcurrent ;
62
61
import rx .operators .OperationOnExceptionResumeNextViaObservable ;
63
62
import rx .operators .OperationParallelMerge ;
64
63
import rx .operators .OperationReplay ;
65
- import rx .operators .OperationSample ;
66
64
import rx .operators .OperationSequenceEqual ;
67
65
import rx .operators .OperationSkip ;
68
66
import rx .operators .OperationSkipUntil ;
73
71
import rx .operators .OperationTakeWhile ;
74
72
import rx .operators .OperationThrottleFirst ;
75
73
import rx .operators .OperationTimeInterval ;
76
- import rx .operators .OperationTimer ;
77
74
import rx .operators .OperationToMap ;
78
75
import rx .operators .OperationToMultimap ;
79
76
import rx .operators .OperationUsing ;
112
109
import rx .operators .OperatorPivot ;
113
110
import rx .operators .OperatorRepeat ;
114
111
import rx .operators .OperatorRetry ;
112
+ import rx .operators .OperatorSampleWithObservable ;
113
+ import rx .operators .OperatorSampleWithTime ;
115
114
import rx .operators .OperatorScan ;
116
115
import rx .operators .OperatorSerialize ;
117
116
import rx .operators .OperatorSingle ;
123
122
import rx .operators .OperatorTake ;
124
123
import rx .operators .OperatorTimeout ;
125
124
import rx .operators .OperatorTimeoutWithSelector ;
125
+ import rx .operators .OperatorTimerOnce ;
126
+ import rx .operators .OperatorTimerPeriodically ;
126
127
import rx .operators .OperatorTimestamp ;
127
128
import rx .operators .OperatorToObservableFuture ;
128
129
import rx .operators .OperatorToObservableList ;
@@ -1505,7 +1506,7 @@ public final static <T> Observable<T> from(T[] items, Scheduler scheduler) {
1505
1506
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229027.aspx">MSDN: Observable.Interval</a>
1506
1507
*/
1507
1508
public final static Observable <Long > interval (long interval , TimeUnit unit ) {
1508
- return create (OperationInterval . interval (interval , unit ));
1509
+ return create (new OperatorTimerPeriodically (interval , interval , unit , Schedulers . computation () ));
1509
1510
}
1510
1511
1511
1512
/**
@@ -1525,7 +1526,7 @@ public final static Observable<Long> interval(long interval, TimeUnit unit) {
1525
1526
* @see <a href="http://msdn.microsoft.com/en-us/library/hh228911.aspx">MSDN: Observable.Interval</a>
1526
1527
*/
1527
1528
public final static Observable <Long > interval (long interval , TimeUnit unit , Scheduler scheduler ) {
1528
- return create (OperationInterval . interval ( interval , unit , scheduler ));
1529
+ return create (new OperatorTimerPeriodically ( interval , interval , unit , scheduler ));
1529
1530
}
1530
1531
1531
1532
/**
@@ -2540,7 +2541,7 @@ public final static Observable<Long> timer(long initialDelay, long period, TimeU
2540
2541
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229652.aspx">MSDN: Observable.Timer</a>
2541
2542
*/
2542
2543
public final static Observable <Long > timer (long initialDelay , long period , TimeUnit unit , Scheduler scheduler ) {
2543
- return create (new OperationTimer . TimerPeriodically (initialDelay , period , unit , scheduler ));
2544
+ return create (new OperatorTimerPeriodically (initialDelay , period , unit , scheduler ));
2544
2545
}
2545
2546
2546
2547
/**
@@ -2552,6 +2553,7 @@ public final static Observable<Long> timer(long initialDelay, long period, TimeU
2552
2553
* the initial delay before emitting a single 0L
2553
2554
* @param unit
2554
2555
* time units to use for {@code delay}
2556
+ * @return an Observable that emits one item after a specified delay, and then completes
2555
2557
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#wiki-timer">RxJava wiki: timer()</a>
2556
2558
*/
2557
2559
public final static Observable <Long > timer (long delay , TimeUnit unit ) {
@@ -2570,10 +2572,12 @@ public final static Observable<Long> timer(long delay, TimeUnit unit) {
2570
2572
* time units to use for {@code delay}
2571
2573
* @param scheduler
2572
2574
* the Scheduler to use for scheduling the item
2575
+ * @return Observable that emits one item after a specified delay, on a specified Scheduler, and then
2576
+ * completes
2573
2577
* @see <a href="https://github.com/Netflix/RxJava/wiki/Creating-Observables#wiki-timer">RxJava wiki: timer()</a>
2574
2578
*/
2575
2579
public final static Observable <Long > timer (long delay , TimeUnit unit , Scheduler scheduler ) {
2576
- return create (new OperationTimer . TimerOnce (delay , unit , scheduler ));
2580
+ return create (new OperatorTimerOnce (delay , unit , scheduler ));
2577
2581
}
2578
2582
2579
2583
/**
@@ -5322,7 +5326,7 @@ public final Observable<T> retry(int retryCount) {
5322
5326
* @see <a href="https://github.com/Netflix/RxJava/wiki/Filtering-Observables#wiki-sample-or-throttlelast">RxJava Wiki: sample()</a>
5323
5327
*/
5324
5328
public final Observable <T > sample (long period , TimeUnit unit ) {
5325
- return create ( OperationSample . sample ( this , period , unit ));
5329
+ return lift ( new OperatorSampleWithTime < T >( period , unit , Schedulers . computation () ));
5326
5330
}
5327
5331
5328
5332
/**
@@ -5342,7 +5346,7 @@ public final Observable<T> sample(long period, TimeUnit unit) {
5342
5346
* @see <a href="https://github.com/Netflix/RxJava/wiki/Filtering-Observables#wiki-sample-or-throttlelast">RxJava Wiki: sample()</a>
5343
5347
*/
5344
5348
public final Observable <T > sample (long period , TimeUnit unit , Scheduler scheduler ) {
5345
- return create ( OperationSample . sample ( this , period , unit , scheduler ));
5349
+ return lift ( new OperatorSampleWithTime < T >( period , unit , scheduler ));
5346
5350
}
5347
5351
5348
5352
/**
@@ -5359,7 +5363,7 @@ public final Observable<T> sample(long period, TimeUnit unit, Scheduler schedule
5359
5363
* @see <a href="https://github.com/Netflix/RxJava/wiki/Filtering-Observables#wiki-sample-or-throttlelast">RxJava Wiki: sample()</a>
5360
5364
*/
5361
5365
public final <U > Observable <T > sample (Observable <U > sampler ) {
5362
- return create (new OperationSample . SampleWithObservable <T , U >(this , sampler ));
5366
+ return lift (new OperatorSampleWithObservable <T , U >(sampler ));
5363
5367
}
5364
5368
5365
5369
/**
0 commit comments