@@ -3220,6 +3220,13 @@ public Observable<T> reduce(Func2<T, T, T> accumulator) {
3220
3220
return reduce (this , accumulator );
3221
3221
}
3222
3222
3223
+ /**
3224
+ * @see #reduce(Func2)
3225
+ */
3226
+ public Observable <T > aggregate (Func2 <T , T , T > accumulator ) {
3227
+ return reduce (accumulator );
3228
+ }
3229
+
3223
3230
/**
3224
3231
* Returns an Observable that applies a function of your choosing to the first item emitted by a
3225
3232
* source Observable, then feeds the result of that function along with the second item emitted
@@ -3246,6 +3253,13 @@ public Observable<T> reduce(Object accumulator) {
3246
3253
return reduce (this , accumulator );
3247
3254
}
3248
3255
3256
+ /**
3257
+ * @see #reduce(Object)
3258
+ */
3259
+ public Observable <T > aggregate (Object accumulator ) {
3260
+ return reduce (accumulator );
3261
+ }
3262
+
3249
3263
/**
3250
3264
* Returns an Observable that applies a function of your choosing to the first item emitted by a
3251
3265
* source Observable, then feeds the result of that function along with the second item emitted
@@ -3270,10 +3284,17 @@ public Observable<T> reduce(Object accumulator) {
3270
3284
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229154(v%3Dvs.103).aspx">MSDN: Observable.Aggregate</a>
3271
3285
* @see <a href="http://en.wikipedia.org/wiki/Fold_(higher-order_function)">Wikipedia: Fold (higher-order function)</a>
3272
3286
*/
3273
- public Observable <T > reduce (T initialValue , Func2 <T , T , T > accumulator ) {
3287
+ public < R > Observable <R > reduce (R initialValue , Func2 <R , T , R > accumulator ) {
3274
3288
return reduce (this , initialValue , accumulator );
3275
3289
}
3276
3290
3291
+ /**
3292
+ * @see #reduce(R, Func2)
3293
+ */
3294
+ public <R > Observable <R > aggregate (R initialValue , Func2 <R , T , R > accumulator ) {
3295
+ return reduce (initialValue , accumulator );
3296
+ }
3297
+
3277
3298
/**
3278
3299
* Returns an Observable that applies a function of your choosing to the first item emitted by a
3279
3300
* source Observable, then feeds the result of that function along with the second item emitted
@@ -3297,10 +3318,17 @@ public Observable<T> reduce(T initialValue, Func2<T, T, T> accumulator) {
3297
3318
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229154(v%3Dvs.103).aspx">MSDN: Observable.Aggregate</a>
3298
3319
* @see <a href="http://en.wikipedia.org/wiki/Fold_(higher-order_function)">Wikipedia: Fold (higher-order function)</a>
3299
3320
*/
3300
- public Observable <T > reduce (T initialValue , Object accumulator ) {
3321
+ public < R > Observable <R > reduce (R initialValue , Object accumulator ) {
3301
3322
return reduce (this , initialValue , accumulator );
3302
3323
}
3303
3324
3325
+ /**
3326
+ * @see #reduce(R, Object)
3327
+ */
3328
+ public <R > Observable <R > aggregate (R initialValue , Object accumulator ) {
3329
+ return reduce (initialValue , accumulator );
3330
+ }
3331
+
3304
3332
/**
3305
3333
* Returns an Observable that applies a function of your choosing to the first item emitted by a
3306
3334
* source Observable, then feeds the result of that function along with the second item emitted
0 commit comments