|
||||||||||
| 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
public class SimpleAvg
Implements a collector that produces as result the arithmetic mean of its observations. The maximum number of observations supported is 2^31.
| Constructor Summary | |
|---|---|
SimpleAvg()
Default constructor. |
|
SimpleAvg(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; it keeps the sum of the observations and a counter, so that the arithmetic mean can be calculated. |
double |
getAverage()
|
int |
getCount()
Returns the number of observations recorded by this collector. |
double[] |
getResults()
Returns the average and the number of observations. |
java.lang.String[] |
getResultsLabels()
Returns {"average", "count"}. |
void |
setup(java.lang.String name,
java.lang.String desc)
Resets this collector. |
| 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 SimpleAvg()
public SimpleAvg(java.lang.String name,
java.lang.String desc)
| Method Detail |
|---|
public void setup(java.lang.String name,
java.lang.String desc)
setup in interface Collectorsetup in class CollectorBasepublic void collect(double value)
public double[] getResults()
public java.lang.String[] getResultsLabels()
public double getAverage()
public int getCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||