explode

Remi Forax forax at univ-mlv.fr
Sat Feb 9 07:44:34 PST 2013


On 02/08/2013 04:47 PM, Brian Goetz wrote:
> OK, just to put it all down on "paper" where flatMap landed...are we 
> OK with this?
>
> java.util.stream.FlatMapper:
>
> public interface FlatMapper<T, U> {
>     void explodeInto(T element, Consumer<U> sink);
>
>     interface ToInt<T> {
>         void explodeInto(T element, IntConsumer sink);
>     }
>
>     interface ToLong<T> {
>         void explodeInto(T element, LongConsumer sink);
>     }
>
>     interface ToDouble<T> {
>         void explodeInto(T element, DoubleConsumer sink);
>     }
>
>     interface OfIntToInt {
>         void explodeInto(int element, IntConsumer sink);
>     }
>
>     interface OfLongToLong {
>         void explodeInto(long element, LongConsumer sink);
>     }
>
>     interface OfDoubleToDouble {
>         void explodeInto(double element, DoubleConsumer sink);
>     }
> }
>
> In Stream:
>
>     <R> Stream<R> flatMap(Function<T, Stream<? extends R>> mapper);

just a wildcard issue:
<R> Stream<R> flatMap(Function<? super T, ? extends Stream<? extends R>> 
mapper);

Rémi



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