Extending Collector to handle a post-transform
Brian Goetz
brian.goetz at oracle.com
Tue Jun 11 10:26:23 PDT 2013
> 1. Reducing boxing during reducing. Currently, the reducing
> collectors will unbox, compute a new result, and rebox, on every
> element. That ugly and slow. With a post-transform, we can use a
> hidden mutable holder as our internal representation, and still only
> expose "Collector from T to Long".
>
> Nice, indeed, but won't the internal type still appear as a type
> parameter of Collector?
Yes, it's not yet "all gain, no pain". Where I am now, the existence of
an internal type still appears; Collector takes type arguments <T, I, R>
(input, intermediate, result), but all the occurrences of Collector in
the API specify ? as the second parameter:
public static Collector<String, ?, String> toStringBuilder()
More information about the lambda-libs-spec-experts
mailing list