|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.stat.descriptive.SummaryStatistics
org.apache.commons.math.stat.descriptive.SynchronizedSummaryStatistics
public class SynchronizedSummaryStatistics
Implementation of
SummaryStatistics
that
is safe to use in a multithreaded environment. Multiple threads can safely
operate on a single instance without causing runtime exceptions due to race
conditions. In effect, this implementation makes modification and access
methods atomic operations for a single instance. That is to say, as one
thread is computing a statistic from the instance, no other thread can modify
the instance nor compute another statistic.
Field Summary | |
---|---|
private static long |
serialVersionUID
Serialization UID |
Fields inherited from class org.apache.commons.math.stat.descriptive.SummaryStatistics |
---|
geoMean, max, mean, min, n, secondMoment, sum, sumLog, sumsq, variance |
Constructor Summary | |
---|---|
SynchronizedSummaryStatistics()
Construct a SynchronizedSummaryStatistics instance |
Method Summary | |
---|---|
void |
addValue(double value)
Add a value to the data |
void |
clear()
Resets all statistics and storage |
boolean |
equals(java.lang.Object object)
Returns true iff object is a SummaryStatistics
instance and all statistics have the same values as this. |
StorelessUnivariateStatistic |
getGeoMeanImpl()
Returns the currently configured geometric mean implementation |
double |
getGeometricMean()
Returns the geometric mean of the values that have been added. |
double |
getMax()
Returns the maximum of the values that have been added. |
StorelessUnivariateStatistic |
getMaxImpl()
Returns the currently configured maximum implementation |
double |
getMean()
Returns the mean of the values that have been added. |
StorelessUnivariateStatistic |
getMeanImpl()
Returns the currently configured mean implementation |
double |
getMin()
Returns the minimum of the values that have been added. |
StorelessUnivariateStatistic |
getMinImpl()
Returns the currently configured minimum implementation |
long |
getN()
Returns the number of available values |
double |
getStandardDeviation()
Returns the standard deviation of the values that have been added. |
double |
getSum()
Returns the sum of the values that have been added |
StorelessUnivariateStatistic |
getSumImpl()
Returns the currently configured Sum implementation |
StorelessUnivariateStatistic |
getSumLogImpl()
Returns the currently configured sum of logs implementation |
StatisticalSummary |
getSummary()
Return a StatisticalSummaryValues instance reporting current
statistics. |
double |
getSumsq()
Returns the sum of the squares of the values that have been added. |
StorelessUnivariateStatistic |
getSumsqImpl()
Returns the currently configured sum of squares implementation |
double |
getVariance()
Returns the variance of the values that have been added. |
StorelessUnivariateStatistic |
getVarianceImpl()
Returns the currently configured variance implementation |
int |
hashCode()
Returns hash code based on values of statistics |
void |
setGeoMeanImpl(StorelessUnivariateStatistic geoMeanImpl)
Sets the implementation for the geometric mean. |
void |
setMaxImpl(StorelessUnivariateStatistic maxImpl)
Sets the implementation for the maximum. |
void |
setMeanImpl(StorelessUnivariateStatistic meanImpl)
Sets the implementation for the mean. |
void |
setMinImpl(StorelessUnivariateStatistic minImpl)
Sets the implementation for the minimum. |
void |
setSumImpl(StorelessUnivariateStatistic sumImpl)
Sets the implementation for the Sum. |
void |
setSumLogImpl(StorelessUnivariateStatistic sumLogImpl)
Sets the implementation for the sum of logs. |
void |
setSumsqImpl(StorelessUnivariateStatistic sumsqImpl)
Sets the implementation for the sum of squares. |
void |
setVarianceImpl(StorelessUnivariateStatistic varianceImpl)
Sets the implementation for the variance. |
java.lang.String |
toString()
Generates a text report displaying summary statistics from values that have been added. |
Methods inherited from class org.apache.commons.math.stat.descriptive.SummaryStatistics |
---|
getSumOfLogs, newInstance, newInstance |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
Constructor Detail |
---|
public SynchronizedSummaryStatistics()
Method Detail |
---|
public StatisticalSummary getSummary()
SummaryStatistics
StatisticalSummaryValues
instance reporting current
statistics.
getSummary
in class SummaryStatistics
SummaryStatistics.getSummary()
public void addValue(double value)
SummaryStatistics
addValue
in class SummaryStatistics
value
- the value to addSummaryStatistics.addValue(double)
public long getN()
SummaryStatistics
getN
in interface StatisticalSummary
getN
in class SummaryStatistics
SummaryStatistics.getN()
public double getSum()
SummaryStatistics
getSum
in interface StatisticalSummary
getSum
in class SummaryStatistics
Double.NaN
if no values have been addedSummaryStatistics.getSum()
public double getSumsq()
SummaryStatistics
Double.NaN is returned if no values have been added.
getSumsq
in class SummaryStatistics
SummaryStatistics.getSumsq()
public double getMean()
SummaryStatistics
Double.NaN is returned if no values have been added.
getMean
in interface StatisticalSummary
getMean
in class SummaryStatistics
SummaryStatistics.getMean()
public double getStandardDeviation()
SummaryStatistics
Double.NaN is returned if no values have been added.
getStandardDeviation
in interface StatisticalSummary
getStandardDeviation
in class SummaryStatistics
SummaryStatistics.getStandardDeviation()
public double getVariance()
SummaryStatistics
Double.NaN is returned if no values have been added.
getVariance
in interface StatisticalSummary
getVariance
in class SummaryStatistics
SummaryStatistics.getVariance()
public double getMax()
SummaryStatistics
Double.NaN is returned if no values have been added.
getMax
in interface StatisticalSummary
getMax
in class SummaryStatistics
SummaryStatistics.getMax()
public double getMin()
SummaryStatistics
Double.NaN is returned if no values have been added.
getMin
in interface StatisticalSummary
getMin
in class SummaryStatistics
SummaryStatistics.getMin()
public double getGeometricMean()
SummaryStatistics
Double.NaN is returned if no values have been added.
getGeometricMean
in class SummaryStatistics
SummaryStatistics.getGeometricMean()
public java.lang.String toString()
SummaryStatistics
toString
in class SummaryStatistics
SummaryStatistics.toString()
public void clear()
SummaryStatistics
clear
in class SummaryStatistics
SummaryStatistics.clear()
public boolean equals(java.lang.Object object)
SummaryStatistics
object
is a SummaryStatistics
instance and all statistics have the same values as this.
equals
in class SummaryStatistics
object
- the object to test equality against.
SummaryStatistics.equals(Object)
public int hashCode()
SummaryStatistics
hashCode
in class SummaryStatistics
SummaryStatistics.hashCode()
public StorelessUnivariateStatistic getSumImpl()
SummaryStatistics
getSumImpl
in class SummaryStatistics
SummaryStatistics.getSumImpl()
public void setSumImpl(StorelessUnivariateStatistic sumImpl)
SummaryStatistics
Sets the implementation for the Sum.
This method must be activated before any data has been added - i.e.,
before addValue
has been used to add data;
otherwise an IllegalStateException will be thrown.
setSumImpl
in class SummaryStatistics
sumImpl
- the StorelessUnivariateStatistic instance to use
for computing the SumSummaryStatistics.setSumImpl(StorelessUnivariateStatistic)
public StorelessUnivariateStatistic getSumsqImpl()
SummaryStatistics
getSumsqImpl
in class SummaryStatistics
SummaryStatistics.getSumsqImpl()
public void setSumsqImpl(StorelessUnivariateStatistic sumsqImpl)
SummaryStatistics
Sets the implementation for the sum of squares.
This method must be activated before any data has been added - i.e.,
before addValue
has been used to add data;
otherwise an IllegalStateException will be thrown.
setSumsqImpl
in class SummaryStatistics
sumsqImpl
- the StorelessUnivariateStatistic instance to use
for computing the sum of squaresSummaryStatistics.setSumsqImpl(StorelessUnivariateStatistic)
public StorelessUnivariateStatistic getMinImpl()
SummaryStatistics
getMinImpl
in class SummaryStatistics
SummaryStatistics.getMinImpl()
public void setMinImpl(StorelessUnivariateStatistic minImpl)
SummaryStatistics
Sets the implementation for the minimum.
This method must be activated before any data has been added - i.e.,
before addValue
has been used to add data;
otherwise an IllegalStateException will be thrown.
setMinImpl
in class SummaryStatistics
minImpl
- the StorelessUnivariateStatistic instance to use
for computing the minimumSummaryStatistics.setMinImpl(StorelessUnivariateStatistic)
public StorelessUnivariateStatistic getMaxImpl()
SummaryStatistics
getMaxImpl
in class SummaryStatistics
SummaryStatistics.getMaxImpl()
public void setMaxImpl(StorelessUnivariateStatistic maxImpl)
SummaryStatistics
Sets the implementation for the maximum.
This method must be activated before any data has been added - i.e.,
before addValue
has been used to add data;
otherwise an IllegalStateException will be thrown.
setMaxImpl
in class SummaryStatistics
maxImpl
- the StorelessUnivariateStatistic instance to use
for computing the maximumSummaryStatistics.setMaxImpl(StorelessUnivariateStatistic)
public StorelessUnivariateStatistic getSumLogImpl()
SummaryStatistics
getSumLogImpl
in class SummaryStatistics
SummaryStatistics.getSumLogImpl()
public void setSumLogImpl(StorelessUnivariateStatistic sumLogImpl)
SummaryStatistics
Sets the implementation for the sum of logs.
This method must be activated before any data has been added - i.e.,
before addValue
has been used to add data;
otherwise an IllegalStateException will be thrown.
setSumLogImpl
in class SummaryStatistics
sumLogImpl
- the StorelessUnivariateStatistic instance to use
for computing the log sumSummaryStatistics.setSumLogImpl(StorelessUnivariateStatistic)
public StorelessUnivariateStatistic getGeoMeanImpl()
SummaryStatistics
getGeoMeanImpl
in class SummaryStatistics
SummaryStatistics.getGeoMeanImpl()
public void setGeoMeanImpl(StorelessUnivariateStatistic geoMeanImpl)
SummaryStatistics
Sets the implementation for the geometric mean.
This method must be activated before any data has been added - i.e.,
before addValue
has been used to add data;
otherwise an IllegalStateException will be thrown.
setGeoMeanImpl
in class SummaryStatistics
geoMeanImpl
- the StorelessUnivariateStatistic instance to use
for computing the geometric meanSummaryStatistics.setGeoMeanImpl(StorelessUnivariateStatistic)
public StorelessUnivariateStatistic getMeanImpl()
SummaryStatistics
getMeanImpl
in class SummaryStatistics
SummaryStatistics.getMeanImpl()
public void setMeanImpl(StorelessUnivariateStatistic meanImpl)
SummaryStatistics
Sets the implementation for the mean.
This method must be activated before any data has been added - i.e.,
before addValue
has been used to add data;
otherwise an IllegalStateException will be thrown.
setMeanImpl
in class SummaryStatistics
meanImpl
- the StorelessUnivariateStatistic instance to use
for computing the meanSummaryStatistics.setMeanImpl(StorelessUnivariateStatistic)
public StorelessUnivariateStatistic getVarianceImpl()
SummaryStatistics
getVarianceImpl
in class SummaryStatistics
SummaryStatistics.getVarianceImpl()
public void setVarianceImpl(StorelessUnivariateStatistic varianceImpl)
SummaryStatistics
Sets the implementation for the variance.
This method must be activated before any data has been added - i.e.,
before addValue
has been used to add data;
otherwise an IllegalStateException will be thrown.
setVarianceImpl
in class SummaryStatistics
varianceImpl
- the StorelessUnivariateStatistic instance to use
for computing the varianceSummaryStatistics.setVarianceImpl(StorelessUnivariateStatistic)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |