Updated State of the Collections

Paul Sandoz paul.sandoz at oracle.com
Fri Nov 16 01:59:28 PST 2012


On Nov 16, 2012, at 10:40 AM, Jose <jgetino at telefonica.net> wrote:
> 
> 
> So flatMap function has two arguments.  For the second one you provide a
> List of authors that you defined previously. 
> 
> But what about the first argument?,  sink is just a variable, it has not
> being initialized at any place 
> 

FlatMapper has two arguments:

    void flatMapInto(Block<? super R> sink, T element);

The second is the element, of type T, to apply the flat map operation.

The first is the Block that accepts zero or more elements, of type R, where an element, of type T, is "flattened" to zero or more elements of type R.

The framework creates an instance of Block.

The framework invokes FlatMapper.flatMapInto(...), the application invokes sink.apply(...) zero or more times.

Paul.


More information about the lambda-dev mailing list