explode (was: Stream method survey responses)

Kevin Bourrillion kevinb at google.com
Mon Feb 4 12:52:17 PST 2013


Only a quick question first:

On Mon, Feb 4, 2013 at 12:37 PM, Brian Goetz <brian.goetz at oracle.com> wrote:

The original API had only:
>
>
>     <U> Stream<U> flatMap(MultiFunction<T,U> mf)
>
> where MultiFunction was (T, Consumer<U>) -> void.  If users already had a
> Collection lying around, they had to iterate it themselves:
>
> (element, sink) -> {
>                      for (U u : findCollection(t))
>                          sink.accept(u);
>                    }
>

Could that simply be (t, sink) -> findCollection(t).forEach(sink) ?


-- 
Kevin Bourrillion | Java Librarian | Google, Inc. | kevinb at google.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20130204/0cacf462/attachment.html 


More information about the lambda-libs-spec-experts mailing list