public interface SampleStatistics extends java.beans.PropertyChangeListener, Named
PropertyChangeListener
so they can respond
to data fired in PropertyChangeEvent
s.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EOL
String for line separator on the platform we are running on.
|
Modifier and Type | Method and Description |
---|---|
int |
getCount()
Gets the number of observations so far.
|
double |
getMaxObs()
Gets the maximum observed value so far.
|
double |
getMean()
Gets the current value of the mean.
|
double |
getMinObs()
Gets the minimum observed value so far.
|
java.lang.String |
getName() |
SamplingType |
getSamplingType()
Returns the SamplingType for this SampleStatistics.
|
double |
getStandardDeviation()
Gets the current value of the standard deviation.
|
double |
getVariance()
Gets the current value of the variance.
|
void |
newObservation(boolean newObs)
Add a new Observation of type
boolean . |
void |
newObservation(java.lang.Boolean newObs)
Add a new Observation of type
Boolean . |
void |
newObservation(double newObs)
Add new observation and update counters (primitive).
|
void |
newObservation(java.lang.Number newObs)
Add new observation and update counters - normally will just call
newObservation(newObs.doubleValue()).
|
void |
reset()
Should reset/initialize all relevant counters.
|
void |
setName(java.lang.String name) |
void |
setNumberFormat(java.text.NumberFormat numberFormat)
Sets the NumberFormat
|
void |
setSamplingType(SamplingType type)
Sets the sampling type to either TALLY or TIME_VARYING.
|
static final java.lang.String EOL
void reset()
void newObservation(double newObs)
newObs
- The new (primitive) observationvoid newObservation(java.lang.Number newObs)
newObs
- The new (Number) observationvoid newObservation(boolean newObs)
boolean
. It is expected that
"true" corresponds to '1' and "false" to 0.newObs
- the boolean observationvoid newObservation(java.lang.Boolean newObs)
Boolean
. It is expected that
"true" corresponds to '1' and "false" to 0.newObs
- the Boolean observationdouble getMean()
double getVariance()
double getStandardDeviation()
int getCount()
double getMinObs()
double getMaxObs()
void setNumberFormat(java.text.NumberFormat numberFormat)
numberFormat
- the new DecimalFormat instancevoid setSamplingType(SamplingType type)
type
- The SamplingType (TALLY or TIME_VARYING).SamplingType getSamplingType()
java.lang.String getName()