|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbcds.tools.stat.CollectorBase
bcds.tools.stat.SimpleAvg
bcds.tools.stat.Average
public class Average
Implements a collector that produces the following: a) arithmetic mean;
b) standard deviation; c) number of observations; d) minimum value;
e) maximum value. The class RunningStdDev
is
used to compute the standard deviation; therefore, the individual
observations are never stored.
Constructor Summary | |
---|---|
Average()
Default constructor. |
|
Average(java.lang.String name,
java.lang.String desc)
Creates a new collector of the given name. |
Method Summary | |
---|---|
void |
collect(double value)
Registers a new observation: updates the sum and observations counter, determines min and max values and updates the object for obtaining the (running) standard deviation. |
double |
getMax()
Returns the maximum value among the observations. |
double |
getMin()
Returns the minimum value among the observations. |
double[] |
getResults()
Returns the arithmetic mean, the standard deviation, the observations counter, and the min and max values, in that order. |
java.lang.String[] |
getResultsLabels()
Returns {"average", "stddev", "count", "min", "max"}. |
double |
getStdDev()
Returns the standard deviation of the observations. |
void |
setup(java.lang.String name,
java.lang.String desc)
Resets this collector. |
Methods inherited from class bcds.tools.stat.SimpleAvg |
---|
getAverage, getCount |
Methods inherited from class bcds.tools.stat.CollectorBase |
---|
equals, getDescription, getName, hashCode, report, report, report, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Average()
public Average(java.lang.String name, java.lang.String desc)
Method Detail |
---|
public void setup(java.lang.String name, java.lang.String desc)
setup
in interface Collector
setup
in class SimpleAvg
public void collect(double value)
collect
in interface Collector
collect
in class SimpleAvg
public double[] getResults()
getResults
in interface Collector
getResults
in class SimpleAvg
public java.lang.String[] getResultsLabels()
getResultsLabels
in interface Collector
getResultsLabels
in class SimpleAvg
public double getMin()
public double getMax()
public double getStdDev()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |