Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zip with iterable, removed old aggregator version and updated tests #741

Merged
merged 1 commit into from
Jan 14, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions rxjava-core/src/main/java/rx/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -2626,6 +2626,40 @@ public static <T1, T2, R> Observable<R> zip(Observable<? extends T1> o1, Observa
return create(OperationZip.zip(o1, o2, zipFunction));
}

/**
* Return an Observable that pairs up values from this Observable and the other
* Observable and applies a function.
* @param <T2> the other value type
* @param <R> the result type
* @param other the other Observable sequence
* @param zipFunction the function that combines the pairs of items from both
* observables and returns a new value
* @return an Observable that pairs up values from this Observable and the other
* Observable and applies a function.
*/
public <T2, R> Observable<R> zip(Observable<? extends T2> other, Func2<? super T, ? super T2, ? extends R> zipFunction) {
return zip(this, other, zipFunction);
}

/**
* Return an Observable that pairs up values from this Observable and an
* Iterable sequence and applies a function.
* <p>
* Note that the other Iterable is evaluated as items appear from this
* Observable and is not pre-consumed, allowing zipping infinite streams
* on either side.
* @param <T2> the other value type
* @param <R> the result type
* @param other the other Iterable sequence
* @param zipFunction the function that combines the pairs of items of
* this Observable and the Iterable
* @return an Observable that pairs up values from this Observable and an
* Iterable sequence and applies a function.
*/
public <T2, R> Observable<R> zip(Iterable<? extends T2> other, Func2<? super T, ? super T2, ? extends R> zipFunction) {
return create(OperationZip.zipIterable(this, other, zipFunction));
}

/**
* Returns an Observable that emits the results of a function of your
* choosing applied to combinations of three items emitted, in sequence, by
Expand Down
Loading