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

[Utils] UberStream - zip with collection or supplier #111

Open
vsubhuman opened this issue Dec 4, 2015 · 0 comments
Open

[Utils] UberStream - zip with collection or supplier #111

vsubhuman opened this issue Dec 4, 2015 · 0 comments

Comments

@vsubhuman
Copy link
Member

UserStream should provider methods:

  1. zip(Iterable<A>):UberStream<Tuple2<T,A>>
  2. zip(Supplier<A>):UberStream<Tuple2<T,A>>
    and optionally:
  3. zip(Stream<A>):UberStream<Tuple2<T,A>>

All methods should zip each element of the current stream with next elements from the specified iterable, or supplier, or stream. Number of elements in the current stream is the limit of elements taken from specified entity. If specified entity doesn't have enough elements - exception should be raised.

Note: type of the result stream should be Tuple2 instead of UberMaps.Entry, since Tuple2 implements entry, but is more specific and perfectly suitable for this usecase. Exisitng zip(Function) may be refactored to also return Tuple2.

Note: zip(Stream) should be implemented only if it will NOT perform immediate termination of any of the used streams (current, or specified). So this method should perform kind of a "stream union" that will be actually performed only when terminating operation is performed on the result stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant