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 theStorelessUnivariateStatistic
interface.Provides default
hashCode()
andequals(Object)
implementations.
-
-
Constructor Summary
Constructors Constructor Description AbstractStorelessUnivariateStatistic()
Empty constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
clear()
Clears the internal state of the Statisticabstract StorelessUnivariateStatistic
copy()
Returns a copy of the statistic with the same internal state.boolean
equals(Object object)
Returns true iffobject
is the same type ofStorelessUnivariateStatistic
(the object's class equals this instance) returning the same values as this forgetResult()
andgetN()
.abstract double
getResult()
Returns the current value of the Statistic.int
hashCode()
Returns hash code based on getResult() and getN().abstract void
increment(double d)
Updates the internal state of the statistic to reflect the addition of the new value.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
-
Methods inherited from interface org.hipparchus.stat.descriptive.StorelessUnivariateStatistic
accept, evaluate, getN, incrementAll, incrementAll
-
Methods inherited from interface org.hipparchus.stat.descriptive.UnivariateStatistic
evaluate
-
-
-
-
Method Detail
-
copy
public abstract StorelessUnivariateStatistic copy()
Returns a copy of the statistic with the same internal state.- Specified by:
copy
in interfaceStorelessUnivariateStatistic
- Specified by:
copy
in interfaceUnivariateStatistic
- Returns:
- a copy of the statistic
-
clear
public abstract void clear()
Clears the internal state of the Statistic- Specified by:
clear
in interfaceStorelessUnivariateStatistic
-
getResult
public abstract double getResult()
Returns the current value of the Statistic.- Specified by:
getResult
in interfaceStorelessUnivariateStatistic
- Returns:
- value of the statistic,
Double.NaN
if 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:
increment
in interfaceStorelessUnivariateStatistic
- Parameters:
d
- the new value.
-
equals
public boolean equals(Object object)
Returns true iffobject
is 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().
-
-