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 - with index #113

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

[Utils] UberStream - with index #113

vsubhuman opened this issue Dec 4, 2015 · 0 comments

Comments

@vsubhuman
Copy link
Member

UberStream should provide methods:

  1. peekWithIndex(BiConsumer<T,Integer>):UberStream<T>
  2. forEachWithIndex(BiConsumer<T,Integer>):void

Specified BiConsumer should receive stream element as first argument, and int value starting from 0 and incremented for each next element of the stream as second argument.

forEachWithIndex is similar to zipping stream with AtomicInteger and performing forEach, but note that peekWithIndex does NOT change type of the current 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