paul.sandoz at oracle.com
Tue Sep 18 05:12:58 PDT 2012
Please see here for a first go at implementing concat:
I chose to implement:
so that the elements of "anotherStream" are concatenated on to end of "stream".
This operation has side-effects.
I am not sure how this operation relates to MapStream.mergeWith.
I pulled out the concatenating of Iterator<Iterator<T>> from TreeUtils, spruced (no pun intended) it up, and placed it in Iterators for reuse.
There is only the dumb parallel implementation. One wonders for the parallel case whether concat should be pseudo-random interleave :-)
I updated the StreamOpTestCase exercise methods to take a Factory<IntermediateOp> since concat has side-effects:
exerciseFOp(data, () -> ConcatOp.make(data.seqStream()));
(Another TODO for these test methods is to select which cases to test).
More information about the lambda-dev