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
How to do a zip operation on 2 EntryStreams? #259
Comments
I did the zip test with 2 normal Lists and found that it doesn't achieve the effect I want, how can I use StreamEx to replace the above for loop? |
I myself have achieved |
` List rows = Lists.newArrayList("a", "b", "c");
does this work ? |
?? my code block |
@loordgek Thanks for learning about the cross API, but I need to use the index to iterate over the relevant elements in a loop, which doesn't have an index, and the EntryStream doesn't have a cross method. |
why do you need the index cant you use the entrystream? |
@loordgek Because at the end of the loop I have to write one of the internally calculated data into a two-dimensional array, the two-dimensional array needs an index, which is the index associated with each element of the loop rows and cols. |
@loordgek You can see from my code at the top that at the end I need to write the index and the calculated data to the array, so I need both the elements and the index in the Cartesian product loop |
i dont know what to put in the characteristics method |
@loordgek The result is incorrect and can be compared to my code below, where the CHARACTERISTICS can be CONCURRENT, as my actual code would use parallel().
|
As I see, no actual feature request is here, and the question was answered. Hence, I close this. |
hi, I have the following pseudo code that I want to rewrite in Stream:
The 2 indexes i and j must be used in the loop。
The way I thought of doing it was to replace the 2-fold for loop with zip and iterate over the elements with index by way of EntryStream.of(allRows), but I found that the zip method is not supported by EntryStream, but is supported by the normal StreamEx class, so how do I do it by way of StreamEx? How can I achieve my requirement by means of StreamEx?
The text was updated successfully, but these errors were encountered: