Collectors inventory

Brian Goetz brian.goetz at oracle.com
Wed Mar 6 14:59:33 PST 2013


Its just like the toStatistics of ParallelArray; it reduces the stream to a Statistics object which has count, sum, min, and max methods.  


On Mar 6, 2013, at 5:57 PM, Joe Bowbeer wrote:

> I don't know what toStatistics does and can't guess, so I don't favor making it top-level on primitive streams.
> 
> I'd rather encapsulate this inside Collectors where there is a chance that some overview documentation might explain what these more arcane (user-friendly?) Collectors methods do.
> 
> I'm all in favor or name changes that make them more self-explanatory.  toMap seems like a step in that direction.
> 
> Joe
> 
> 
> On Wed, Mar 6, 2013 at 2:51 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> Breaking this into multiple messages.
> 
> > 3. Move toStatistics directly to IntStream, LongStream, DoubleStream instead of using stream.collect(toStatistics())
> 
> No objection to adding these to IntStream and friends (one-liner), but I think it also has to stay in Collectors, so that you can do things like gather statistics on properties of object streams, such as "sales volume statistics by salesman" queries.
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20130306/1969f147/attachment-0001.html 


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