48
48
import rx .observers .SafeSubscriber ;
49
49
import rx .operators .OnSubscribeFromIterable ;
50
50
import rx .operators .OnSubscribeRange ;
51
- import rx .operators .OperationBuffer ;
52
51
import rx .operators .OperationCombineLatest ;
53
52
import rx .operators .OperationConcat ;
54
53
import rx .operators .OperationDebounce ;
93
92
import rx .operators .OperatorAmb ;
94
93
import rx .operators .OperatorAny ;
95
94
import rx .operators .OperatorAsObservable ;
95
+ import rx .operators .OperatorBufferWithSingleObservable ;
96
+ import rx .operators .OperatorBufferWithSize ;
97
+ import rx .operators .OperatorBufferWithStartEndObservable ;
98
+ import rx .operators .OperatorBufferWithTime ;
96
99
import rx .operators .OperatorCache ;
97
100
import rx .operators .OperatorCast ;
98
101
import rx .operators .OperatorDoOnEach ;
@@ -2973,7 +2976,7 @@ public final Observable<T> asObservable() {
2973
2976
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-buffer">RxJava Wiki: buffer()</a>
2974
2977
*/
2975
2978
public final <TClosing > Observable <List <T >> buffer (Func0 <? extends Observable <? extends TClosing >> bufferClosingSelector ) {
2976
- return create ( OperationBuffer . buffer ( this , bufferClosingSelector ));
2979
+ return lift ( new OperatorBufferWithSingleObservable < T , TClosing >( bufferClosingSelector , 16 ));
2977
2980
}
2978
2981
2979
2982
/**
@@ -2990,7 +2993,7 @@ public final <TClosing> Observable<List<T>> buffer(Func0<? extends Observable<?
2990
2993
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-buffer">RxJava Wiki: buffer()</a>
2991
2994
*/
2992
2995
public final Observable <List <T >> buffer (int count ) {
2993
- return create ( OperationBuffer . buffer ( this , count ));
2996
+ return lift ( new OperatorBufferWithSize < T >( count , count ));
2994
2997
}
2995
2998
2996
2999
/**
@@ -3011,7 +3014,7 @@ public final Observable<List<T>> buffer(int count) {
3011
3014
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-buffer">RxJava Wiki: buffer()</a>
3012
3015
*/
3013
3016
public final Observable <List <T >> buffer (int count , int skip ) {
3014
- return create ( OperationBuffer . buffer ( this , count , skip ));
3017
+ return lift ( new OperatorBufferWithSize < T >( count , skip ));
3015
3018
}
3016
3019
3017
3020
/**
@@ -3034,7 +3037,7 @@ public final Observable<List<T>> buffer(int count, int skip) {
3034
3037
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-buffer">RxJava Wiki: buffer()</a>
3035
3038
*/
3036
3039
public final Observable <List <T >> buffer (long timespan , long timeshift , TimeUnit unit ) {
3037
- return create ( OperationBuffer . buffer ( this , timespan , timeshift , unit ));
3040
+ return lift ( new OperatorBufferWithTime < T >( timespan , timeshift , unit , Integer . MAX_VALUE , Schedulers . computation () ));
3038
3041
}
3039
3042
3040
3043
/**
@@ -3058,7 +3061,7 @@ public final Observable<List<T>> buffer(long timespan, long timeshift, TimeUnit
3058
3061
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-buffer">RxJava Wiki: buffer()</a>
3059
3062
*/
3060
3063
public final Observable <List <T >> buffer (long timespan , long timeshift , TimeUnit unit , Scheduler scheduler ) {
3061
- return create ( OperationBuffer . buffer ( this , timespan , timeshift , unit , scheduler ));
3064
+ return lift ( new OperatorBufferWithTime < T >( timespan , timeshift , unit , Integer . MAX_VALUE , scheduler ));
3062
3065
}
3063
3066
3064
3067
/**
@@ -3079,7 +3082,7 @@ public final Observable<List<T>> buffer(long timespan, long timeshift, TimeUnit
3079
3082
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-buffer">RxJava Wiki: buffer()</a>
3080
3083
*/
3081
3084
public final Observable <List <T >> buffer (long timespan , TimeUnit unit ) {
3082
- return create ( OperationBuffer . buffer ( this , timespan , unit ));
3085
+ return lift ( new OperatorBufferWithTime < T >( timespan , timespan , unit , Integer . MAX_VALUE , Schedulers . computation () ));
3083
3086
}
3084
3087
3085
3088
/**
@@ -3104,7 +3107,7 @@ public final Observable<List<T>> buffer(long timespan, TimeUnit unit) {
3104
3107
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-buffer">RxJava Wiki: buffer()</a>
3105
3108
*/
3106
3109
public final Observable <List <T >> buffer (long timespan , TimeUnit unit , int count ) {
3107
- return create ( OperationBuffer . buffer ( this , timespan , unit , count ));
3110
+ return lift ( new OperatorBufferWithTime < T >( timespan , timespan , unit , count , Schedulers . computation () ));
3108
3111
}
3109
3112
3110
3113
/**
@@ -3132,7 +3135,7 @@ public final Observable<List<T>> buffer(long timespan, TimeUnit unit, int count)
3132
3135
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-buffer">RxJava Wiki: buffer()</a>
3133
3136
*/
3134
3137
public final Observable <List <T >> buffer (long timespan , TimeUnit unit , int count , Scheduler scheduler ) {
3135
- return create ( OperationBuffer . buffer ( this , timespan , unit , count , scheduler ));
3138
+ return lift ( new OperatorBufferWithTime < T >( timespan , timespan , unit , count , scheduler ));
3136
3139
}
3137
3140
3138
3141
/**
@@ -3156,7 +3159,7 @@ public final Observable<List<T>> buffer(long timespan, TimeUnit unit, int count,
3156
3159
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-buffer">RxJava Wiki: buffer()</a>
3157
3160
*/
3158
3161
public final Observable <List <T >> buffer (long timespan , TimeUnit unit , Scheduler scheduler ) {
3159
- return create ( OperationBuffer . buffer ( this , timespan , unit , scheduler ));
3162
+ return lift ( new OperatorBufferWithTime < T >( timespan , timespan , unit , Integer . MAX_VALUE , scheduler ));
3160
3163
}
3161
3164
3162
3165
/**
@@ -3176,7 +3179,7 @@ public final Observable<List<T>> buffer(long timespan, TimeUnit unit, Scheduler
3176
3179
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-buffer">RxJava Wiki: buffer()</a>
3177
3180
*/
3178
3181
public final <TOpening , TClosing > Observable <List <T >> buffer (Observable <? extends TOpening > bufferOpenings , Func1 <? super TOpening , ? extends Observable <? extends TClosing >> bufferClosingSelector ) {
3179
- return create ( OperationBuffer . buffer ( this , bufferOpenings , bufferClosingSelector ));
3182
+ return lift ( new OperatorBufferWithStartEndObservable < T , TOpening , TClosing >( bufferOpenings , bufferClosingSelector ));
3180
3183
}
3181
3184
3182
3185
/**
@@ -3198,7 +3201,7 @@ public final <TOpening, TClosing> Observable<List<T>> buffer(Observable<? extend
3198
3201
* @see <a href="https://github.com/Netflix/RxJava/wiki/Transforming-Observables#wiki-buffer">RxJava Wiki: buffer()</a>
3199
3202
*/
3200
3203
public final <B > Observable <List <T >> buffer (Observable <B > boundary ) {
3201
- return create ( OperationBuffer . bufferWithBoundaryObservable ( this , boundary ));
3204
+ return lift ( new OperatorBufferWithSingleObservable < T , B >( boundary , 16 ));
3202
3205
}
3203
3206
3204
3207
/**
@@ -3222,7 +3225,7 @@ public final <B> Observable<List<T>> buffer(Observable<B> boundary) {
3222
3225
* @see #buffer(rx.Observable, int)
3223
3226
*/
3224
3227
public final <B > Observable <List <T >> buffer (Observable <B > boundary , int initialCapacity ) {
3225
- return create ( OperationBuffer . bufferWithBoundaryObservable ( this , boundary , initialCapacity ));
3228
+ return lift ( new OperatorBufferWithSingleObservable < T , B >( boundary , initialCapacity ));
3226
3229
}
3227
3230
3228
3231
/**
0 commit comments