Fwd: 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
Tue Mar 19 10:45:44 PDT 2013
The changeset referenced below moves the XxxStatistics classes to
top-level in java.util.stream for now, but we should decide where they
go as they are useful beyond just streams. I also reverted the use of
Optional here, because there is a way to distinguish between the return
of the default value and "no data" -- count() == 0.
We have specialized versions for each of the components (count, sum,
average, min, max) for those for whom computing all the statistics is
too slow. I added statistics() as a method to the primitive streams as
well (simple implementation: collect(XxxStats::new, XxxStats::add,
XxxStats::combine)).
One thing missing from this basic set of summary statistics is "sum of
squares", which is needed for all sorts of statistical calculations.
-------- Original Message --------
Subject: 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
Date: Mon, 18 Mar 2013 17:27:47 +0000
From: brian.goetz at oracle.com
To: lambda-dev at openjdk.java.net
Changeset: 1a6b75a82fe0
Author: briangoetz
Date: 2013-03-18 13:06 -0400
URL: http://hg.openjdk.java.net/lambda/lambda/jdk/rev/1a6b75a82fe0
More information about the lambda-libs-spec-experts
mailing list