|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.stat.descriptive.DescriptiveStatistics
org.apache.commons.math.stat.descriptive.SynchronizedDescriptiveStatistics
public class SynchronizedDescriptiveStatistics
Implementation of
DescriptiveStatistics
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.DescriptiveStatistics |
---|
eDA, INFINITE_WINDOW, windowSize |
Constructor Summary | |
---|---|
SynchronizedDescriptiveStatistics()
Construct an instance with infinite window |
|
SynchronizedDescriptiveStatistics(int window)
Construct an instance with finite window |
Method Summary | |
---|---|
void |
addValue(double v)
Adds the value to the dataset. |
double |
apply(UnivariateStatistic stat)
Apply the given statistic to this univariate collection. |
void |
clear()
Resets all statistics and storage |
double |
getElement(int index)
Returns the element at the specified index |
long |
getN()
Returns the number of available values |
double |
getStandardDeviation()
Returns the standard deviation of the available values. |
double[] |
getValues()
Returns the current set of values in an array of double primitives. |
int |
getWindowSize()
Access the window size. |
void |
setWindowSize(int windowSize)
WindowSize controls the number of values which contribute to the reported statistics. |
java.lang.String |
toString()
Generates a text report displaying univariate statistics from values that have been added. |
Methods inherited from class org.apache.commons.math.stat.descriptive.DescriptiveStatistics |
---|
getGeometricMean, getGeometricMeanImpl, getKurtosis, getKurtosisImpl, getMax, getMaxImpl, getMean, getMeanImpl, getMin, getMinImpl, getPercentile, getPercentileImpl, getSkewness, getSkewnessImpl, getSortedValues, getSum, getSumImpl, getSumsq, getSumsqImpl, getVariance, getVarianceImpl, newInstance, newInstance, setGeometricMeanImpl, setKurtosisImpl, setMaxImpl, setMeanImpl, setMinImpl, setPercentileImpl, setSkewnessImpl, setSumImpl, setSumsqImpl, setVarianceImpl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
Constructor Detail |
---|
public SynchronizedDescriptiveStatistics()
public SynchronizedDescriptiveStatistics(int window)
window
- the finite window size.Method Detail |
---|
public void addValue(double v)
DescriptiveStatistics
addValue
in class DescriptiveStatistics
v
- the value to be addedDescriptiveStatistics.addValue(double)
public double apply(UnivariateStatistic stat)
apply
in class DescriptiveStatistics
stat
- the statistic to apply
public void clear()
DescriptiveStatistics
clear
in class DescriptiveStatistics
DescriptiveStatistics.clear()
public double getElement(int index)
DescriptiveStatistics
getElement
in class DescriptiveStatistics
index
- The Index of the element
DescriptiveStatistics.getElement(int)
public long getN()
DescriptiveStatistics
getN
in interface StatisticalSummary
getN
in class DescriptiveStatistics
DescriptiveStatistics.getN()
public double getStandardDeviation()
getStandardDeviation
in interface StatisticalSummary
getStandardDeviation
in class DescriptiveStatistics
public double[] getValues()
DescriptiveStatistics
getValues
in class DescriptiveStatistics
DescriptiveStatistics.getValues()
public int getWindowSize()
getWindowSize
in class DescriptiveStatistics
public void setWindowSize(int windowSize)
DescriptiveStatistics
setWindowSize
in class DescriptiveStatistics
windowSize
- sets the size of the window.DescriptiveStatistics.setWindowSize(int)
public java.lang.String toString()
toString
in class DescriptiveStatistics
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |