public class MeanAccumulator extends Object
| Constructor and Description |
|---|
MeanAccumulator()
Construct a new, zeroed average accumulator.
|
MeanAccumulator(double sum,
long count)
Initialize the
MeanAccumulator with a pre-calculated sum and
the amount of values included. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(double datum)
Add a new datum to the
MeanAccumulator. |
long |
getCount() |
double |
getMean() |
double |
getTotal()
Get the total of the values accumulated so far.
|
String |
toString() |
public MeanAccumulator()
public MeanAccumulator(double sum,
long count)
MeanAccumulator with a pre-calculated sum and
the amount of values included.sum - pre-calculated sumcount - amount of values that where used to build this sumpublic void add(double datum)
MeanAccumulator.datum - new datum to include into the average.public double getMean()
public double getTotal()
public long getCount()