hg: lambda/lambda/jdk: Eliminate Collector.Of{Int,Long,Double}; make {Int,Long,Double}Statistics top-level classes; add .statistics() methods to {Int,Long,DOuble}Stream; add Collectors.to{ILD}Statistics(mapper); add Collectors.reduce(mapper, reducer); eliminate Collectors.mapper forms; more efficient implementation of {ILD}Stream.average

Brian Goetz brian.goetz at oracle.com
Wed Mar 20 12:25:00 PDT 2013


> I think the "statistics" method names and the Statistics class names are
> out of place at the top level.
 >
 > The main problem is that statistics is too vague.  It could refer to
 > almost anything, and so I find it distracting.

Joe and I had an offline discussion and we both like "SummaryStatistics" 
as a name, which is common with ParallelArray.  It better captures the 
summary statistics we're gathering: count/sum/min/max.

The question is open about where to put it.  I am open to suggestions. 
It has no dependency on anything in j.u.stream.

I am on the fence about sum of squares.  In most of the times I've 
needed to gather more than one summary statistic about a population, I 
eventually wanted sample variance too.  Of course, there's a slippery 
slope -- geometric mean, median, mode, t-statistics.  But I think we can 
make a compelling enough argument for stopping either right before 
sum(sq) or right after.



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