RFR : 8010953: Add primitive summary statistics utils

David Holmes david.holmes at oracle.com
Tue Apr 16 03:10:17 PDT 2013


Hi Mike,

On 16/04/2013 9:30 AM, Mike Duigou wrote:
> Hello all;
>
> Another integration review in the JSR-335 libraries series. These three classes provide a utility for conveniently finding count, sum, min,  max and average of ints, longs or doubles. They can be used with existing code but will most likely be used with the Collectors utilities or directly with primitive or boxed streams.
>
> http://cr.openjdk.java.net/~mduigou/JDK-8010953/1/webrev/
>
> (this is an updated version of the webrev sent to core-libs-dev).

A couple of minor nits:

DoubleSummaryStatistics:

getMin/getMax:

The main doc should read the same as the @return. Presently the initial 
sentence:

  120      * Returns the recorded value closest to {@code 
Double.NEGATIVE_INFINITY},
  121      * {@code Double.POSITIVE_INFINITY} if no values have been 
recorded or if
  122      * any recorded value is NaN, then the result is NaN.

if very difficult to read and parse. The @return is much simpler - just 
say minimum/maximum value recorded, rather than "value closest to ...".

In all classes:

minimal -> minimum
maximal -> maximum

David

> Mike
>


More information about the lambda-dev mailing list