public class SampleStat extends Object
限定符和类型 | 类和说明 |
---|---|
static class |
SampleStat.MinMax
Helper to keep running min/max
|
构造器和说明 |
---|
SampleStat()
Construct a new running sample stat
|
限定符和类型 | 方法和说明 |
---|---|
SampleStat |
add(double x)
Add a sample the running stat.
|
SampleStat |
add(long nSamples,
double x)
Add some sample and a partial sum to the running stat.
|
void |
copyTo(SampleStat other)
Copy the values to other (saves object creation and gc.)
|
double |
max() |
double |
mean() |
double |
min() |
long |
numSamples() |
void |
reset() |
double |
stddev() |
double |
variance() |
public void reset()
public void copyTo(SampleStat other)
other
- the destination to hold our valuespublic SampleStat add(double x)
x
- the sample numberpublic SampleStat add(long nSamples, double x)
nSamples
- number of samplesx
- the partial sumpublic long numSamples()
public double mean()
public double variance()
public double stddev()
public double min()
public double max()
Copyright © 2009 The Apache Software Foundation