jdk/src/share/classes/java/util/LongSummaryStatistics.java
author malenkov
Tue, 29 Oct 2013 17:01:06 +0400
changeset 21278 ef8a3a2a72f2
parent 19214 e5901820c3c1
child 24513 2b9212fa87d8
permissions -rw-r--r--
8022746: List of spelling errors in API doc Reviewed-by: alexsch, smarks
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16922
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
     1
/*
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
     2
 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
     4
 *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    10
 *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    15
 * accompanied this code).
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    16
 *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    20
 *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    23
 * questions.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    24
 */
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    25
package java.util;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    26
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    27
import java.util.function.IntConsumer;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    28
import java.util.function.LongConsumer;
19214
e5901820c3c1 8015318: Extend Collector with 'finish' operation
briangoetz
parents: 17927
diff changeset
    29
import java.util.stream.Collector;
16922
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    30
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    31
/**
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    32
 * A state object for collecting statistics such as count, min, max, sum, and
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    33
 * average.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    34
 *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    35
 * <p>This class is designed to work with (though does not require)
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    36
 * {@linkplain java.util.stream streams}. For example, you can compute
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    37
 * summary statistics on a stream of longs with:
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    38
 * <pre> {@code
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    39
 * LongSummaryStatistics stats = longStream.collect(LongSummaryStatistics::new,
19214
e5901820c3c1 8015318: Extend Collector with 'finish' operation
briangoetz
parents: 17927
diff changeset
    40
 *                                                  LongSummaryStatistics::accept,
e5901820c3c1 8015318: Extend Collector with 'finish' operation
briangoetz
parents: 17927
diff changeset
    41
 *                                                  LongSummaryStatistics::combine);
16922
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    42
 * }</pre>
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    43
 *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    44
 * <p>{@code LongSummaryStatistics} can be used as a
19214
e5901820c3c1 8015318: Extend Collector with 'finish' operation
briangoetz
parents: 17927
diff changeset
    45
 * {@linkplain java.util.stream.Stream#collect(Collector)} reduction}
16922
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    46
 * target for a {@linkplain java.util.stream.Stream stream}. For example:
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    47
 *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    48
 * <pre> {@code
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    49
 * LongSummaryStatistics stats = people.stream()
19214
e5901820c3c1 8015318: Extend Collector with 'finish' operation
briangoetz
parents: 17927
diff changeset
    50
 *                                     .collect(Collectors.summarizingLong(Person::getAge));
16922
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    51
 *}</pre>
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    52
 *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    53
 * This computes, in a single pass, the count of people, as well as the minimum,
19214
e5901820c3c1 8015318: Extend Collector with 'finish' operation
briangoetz
parents: 17927
diff changeset
    54
 * maximum, sum, and average of their ages.
16922
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    55
 *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    56
 * @implNote This implementation is not thread safe. However, it is safe to use
19214
e5901820c3c1 8015318: Extend Collector with 'finish' operation
briangoetz
parents: 17927
diff changeset
    57
 * {@link java.util.stream.Collectors#summarizingLong(java.util.function.ToLongFunction)
16922
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    58
 * Collectors.toLongStatistics()} on a parallel stream, because the parallel
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    59
 * implementation of {@link java.util.stream.Stream#collect Stream.collect()}
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    60
 * provides the necessary partitioning, isolation, and merging of results for
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    61
 * safe and efficient parallel execution.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    62
 *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    63
 * <p>This implementation does not check for overflow of the sum.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    64
 * @since 1.8
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    65
 */
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    66
public class LongSummaryStatistics implements LongConsumer, IntConsumer {
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    67
    private long count;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    68
    private long sum;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    69
    private long min = Long.MAX_VALUE;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    70
    private long max = Long.MIN_VALUE;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    71
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    72
    /**
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    73
     * Construct an empty instance with zero count, zero sum,
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    74
     * {@code Long.MAX_VALUE} min, {@code Long.MIN_VALUE} max and zero
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    75
     * average.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    76
     */
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    77
    public LongSummaryStatistics() { }
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    78
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    79
    /**
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    80
     * Records a new {@code int} value into the summary information.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    81
     *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    82
     * @param value the input value
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    83
     */
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    84
    @Override
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    85
    public void accept(int value) {
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    86
        accept((long) value);
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    87
    }
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    88
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    89
    /**
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    90
     * Records a new {@code long} value into the summary information.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    91
     *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    92
     * @param value the input value
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    93
     */
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    94
    @Override
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    95
    public void accept(long value) {
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    96
        ++count;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    97
        sum += value;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    98
        min = Math.min(min, value);
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
    99
        max = Math.max(max, value);
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   100
    }
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   101
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   102
    /**
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   103
     * Combines the state of another {@code LongSummaryStatistics} into this
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   104
     * one.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   105
     *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   106
     * @param other another {@code LongSummaryStatistics}
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   107
     * @throws NullPointerException if {@code other} is null
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   108
     */
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   109
    public void combine(LongSummaryStatistics other) {
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   110
        count += other.count;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   111
        sum += other.sum;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   112
        min = Math.min(min, other.min);
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   113
        max = Math.max(max, other.max);
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   114
    }
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   115
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   116
    /**
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   117
     * Returns the count of values recorded.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   118
     *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   119
     * @return the count of values
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   120
     */
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   121
    public final long getCount() {
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   122
        return count;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   123
    }
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   124
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   125
    /**
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   126
     * Returns the sum of values recorded, or zero if no values have been
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   127
     * recorded.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   128
     *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   129
     * @return the sum of values, or zero if none
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   130
     */
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   131
    public final long getSum() {
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   132
        return sum;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   133
    }
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   134
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   135
    /**
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   136
     * Returns the minimum value recorded, or {@code Long.MAX_VALUE} if no
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   137
     * values have been recorded.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   138
     *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   139
     * @return the minimum value, or {@code Long.MAX_VALUE} if none
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   140
     */
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   141
    public final long getMin() {
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   142
        return min;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   143
    }
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   144
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   145
    /**
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   146
     * Returns the maximum value recorded, or {@code Long.MIN_VALUE} if no
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   147
     * values have been recorded
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   148
     *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   149
     * @return the maximum value, or {@code Long.MIN_VALUE} if none
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   150
     */
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   151
    public final long getMax() {
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   152
        return max;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   153
    }
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   154
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   155
    /**
19214
e5901820c3c1 8015318: Extend Collector with 'finish' operation
briangoetz
parents: 17927
diff changeset
   156
     * Returns the arithmetic mean of values recorded, or zero if no values have been
16922
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   157
     * recorded.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   158
     *
19214
e5901820c3c1 8015318: Extend Collector with 'finish' operation
briangoetz
parents: 17927
diff changeset
   159
     * @return The arithmetic mean of values, or zero if none
16922
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   160
     */
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   161
    public final double getAverage() {
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   162
        return getCount() > 0 ? (double) getSum() / getCount() : 0.0d;
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   163
    }
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   164
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   165
    @Override
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   166
    /**
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   167
     * {@inheritDoc}
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   168
     *
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   169
     * Returns a non-empty string representation of this object suitable for
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   170
     * debugging. The exact presentation format is unspecified and may vary
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   171
     * between implementations and versions.
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   172
     */
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   173
    public String toString() {
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   174
        return String.format(
17927
dc3d1b30cb78 8015686: {Int|Long}SummaryStatistics toString() throws IllegalFormatConversionException
mduigou
parents: 16922
diff changeset
   175
            "%s{count=%d, sum=%d, min=%d, average=%f, max=%d}",
16922
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   176
            this.getClass().getSimpleName(),
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   177
            getCount(),
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   178
            getSum(),
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   179
            getMin(),
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   180
            getAverage(),
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   181
            getMax());
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   182
    }
6c918c972850 8010953: Add primitive summary statistics utils
mduigou
parents:
diff changeset
   183
}