Package org.hipparchus.stat.descriptive
Class AbstractStorelessUnivariateStatistic
java.lang.Object
org.hipparchus.stat.descriptive.AbstractStorelessUnivariateStatistic
- All Implemented Interfaces:
DoubleConsumer,StorelessUnivariateStatistic,UnivariateStatistic,MathArrays.Function
- Direct Known Subclasses:
GeometricMean,Kurtosis,Max,Mean,Min,Product,PSquarePercentile,RandomPercentile,SecondMoment,Skewness,StandardDeviation,Sum,SumOfLogs,SumOfSquares,Variance
public abstract class AbstractStorelessUnivariateStatistic
extends Object
implements StorelessUnivariateStatistic
Abstract base class for implementations of the
StorelessUnivariateStatistic interface.
Provides default hashCode() and equals(Object)
implementations.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmpty constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclear()Clears the internal state of the Statisticabstract StorelessUnivariateStatisticcopy()Returns a copy of the statistic with the same internal state.booleanReturns true iffobjectis the same type ofStorelessUnivariateStatistic(the object's class equals this instance) returning the same values as this forgetResult()andgetN().abstract doubleReturns the current value of the Statistic.inthashCode()Returns hash code based on getResult() and getN().abstract voidincrement(double d) Updates the internal state of the statistic to reflect the addition of the new value.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.function.DoubleConsumer
andThenMethods inherited from interface org.hipparchus.stat.descriptive.StorelessUnivariateStatistic
accept, evaluate, getN, incrementAll, incrementAllMethods inherited from interface org.hipparchus.stat.descriptive.UnivariateStatistic
evaluate
-
Constructor Details
-
AbstractStorelessUnivariateStatistic
protected AbstractStorelessUnivariateStatistic()Empty constructor.This constructor is not strictly necessary, but it prevents spurious javadoc warnings with JDK 18 and later.
- Since:
- 3.0
-
-
Method Details
-
copy
Returns a copy of the statistic with the same internal state.- Specified by:
copyin interfaceStorelessUnivariateStatistic- Specified by:
copyin interfaceUnivariateStatistic- Returns:
- a copy of the statistic
-
clear
public abstract void clear()Clears the internal state of the Statistic- Specified by:
clearin interfaceStorelessUnivariateStatistic
-
getResult
public abstract double getResult()Returns the current value of the Statistic.- Specified by:
getResultin interfaceStorelessUnivariateStatistic- Returns:
- value of the statistic,
Double.NaNif it has been cleared or just instantiated.
-
increment
public abstract void increment(double d) Updates the internal state of the statistic to reflect the addition of the new value.- Specified by:
incrementin interfaceStorelessUnivariateStatistic- Parameters:
d- the new value.
-
equals
Returns true iffobjectis the same type ofStorelessUnivariateStatistic(the object's class equals this instance) returning the same values as this forgetResult()andgetN(). -
hashCode
public int hashCode()Returns hash code based on getResult() and getN(). -
toString
-