An aggregator for
SummaryStatistics from several data sets or
data set partitions. In its simplest usage mode, the client creates an
instance via the zero-argument constructor, then uses
#createContributingStatistics() to obtain a
SummaryStatisticsfor each individual data set / partition. The per-set statistics objects
are used as normal, and at any time the aggregate statistics for all the
contributors can be obtained from this object.
Clients with specialized requirements can use alternative constructors to
control the statistics implementations and initial values used by the
contributing and the internal aggregate
SummaryStatistics objects.
A static
#aggregate(Collection) method is also included that computes
aggregate statistics directly from a Collection of SummaryStatistics instances.
When
#createContributingStatistics() is used to create SummaryStatistics
instances to be aggregated concurrently, the created instances'
SummaryStatistics#addValue(double) methods must synchronize on the aggregating
instance maintained by this class. In multithreaded environments, if the functionality
provided by
#aggregate(Collection) is adequate, that method should be used
to avoid unecessary computation and synchronization delays.