Into (original) (raw)
Remi Forax forax at univ-mlv.fr
Tue Dec 25 15:43:31 PST 2012
- Previous message: Into
- Next message: Into
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12/25/2012 12:25 AM, Joe Bowbeer wrote:
I was going to say something about into() here but the topic has morphed to sequential()?
yes, true.
I agree with Brian that into is not as great as it can be but I think the problem is the interface Destination that into uses. We have the Spliterator interface that can recursively divide a data structure, into should use the dual concept that is able to gather several parts together to create a new data structure.
interface Demultiplexer<T,C> { // find a better name C create(Chunks chunks); }
interface Chunks { int getChunkCountIfKnown(); // number of chunks int getTotalSizeIfKnown(); // total number of elements Stream nextChunk(); // get each chunks, return null if no more chunk }
with into declared like this: C into(Demultiplexer<? super T, ? extends C> demux) and a new method in stream which is able to copy the stream elements into an array at a specific offset.
Rémi
- Previous message: Into
- Next message: Into
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-experts mailing list