Package com.gengoai.math
Class EnhancedDoubleStatistics
- java.lang.Object
-
- com.gengoai.math.EnhancedDoubleStatistics
-
- All Implemented Interfaces:
SerializableDoubleConsumer
,Serializable
,DoubleConsumer
public final class EnhancedDoubleStatistics extends Object implements SerializableDoubleConsumer
Enhanced version of
DoubleSummaryStatistics
that provides average, variance, and standard deviation.- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EnhancedDoubleStatistics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(double value)
void
clear()
Clears the accumulated values.void
combine(EnhancedDoubleStatistics other)
Adds the statistics collected by another EnhancedDoubleStatistics objectboolean
equals(Object obj)
double
getAverage()
Gets the average.double
getCount()
Gets the number items accepted.double
getMax()
Gets the max.double
getMin()
Gets the min.double
getPopulationStandardDeviation()
Gets the population standard deviation.double
getPopulationVariance()
Gets the population variance.double
getSampleStandardDeviation()
Gets the sample standard deviation.double
getSampleVariance()
Gets the sample variance.double
getSum()
Gets the sum.double
getSumOfSquares()
Gets the sum of squares.int
hashCode()
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.function.DoubleConsumer
andThen
-
-
-
-
Method Detail
-
accept
public void accept(double value)
- Specified by:
accept
in interfaceDoubleConsumer
-
clear
public void clear()
Clears the accumulated values.
-
combine
public void combine(EnhancedDoubleStatistics other)
Adds the statistics collected by another EnhancedDoubleStatistics object
- Parameters:
other
- the other EnhancedDoubleStatistics to combine- Throws:
NullPointerException
- if the other EnhancedDoubleStatistics is null
-
getCount
public double getCount()
Gets the number items accepted.- Returns:
- the count
-
getSum
public double getSum()
Gets the sum.- Returns:
- the sum
-
getSumOfSquares
public double getSumOfSquares()
Gets the sum of squares.- Returns:
- the sum of squares
-
getAverage
public double getAverage()
Gets the average.- Returns:
- the average
-
getMin
public double getMin()
Gets the min.- Returns:
- the min
-
getMax
public double getMax()
Gets the max.- Returns:
- the max
-
getSampleStandardDeviation
public double getSampleStandardDeviation()
Gets the sample standard deviation.- Returns:
- the sample standard deviation
-
getSampleVariance
public double getSampleVariance()
Gets the sample variance.- Returns:
- the sample variance
-
getPopulationStandardDeviation
public double getPopulationStandardDeviation()
Gets the population standard deviation.- Returns:
- the population standard deviation
-
getPopulationVariance
public double getPopulationVariance()
Gets the population variance.- Returns:
- the population variance
-
-