Class AbstractStorelessUnivariateStatistic

java.lang.Object
org.apache.commons.math4.stat.descriptive.AbstractStorelessUnivariateStatistic
All Implemented Interfaces:
StorelessUnivariateStatistic, UnivariateStatistic, MathArrays.Function
Direct Known Subclasses:
GeometricMean, Kurtosis, Max, Mean, Min, Product, PSquarePercentile, SecondMoment, Skewness, StandardDeviation, Sum, SumOfLogs, SumOfSquares, Variance

public abstract class AbstractStorelessUnivariateStatistic
extends java.lang.Object
implements StorelessUnivariateStatistic
Abstract base class for implementations of the StorelessUnivariateStatistic interface.

Provides default evaluate(double[],...) and incrementAll(double[]) implementations.

Note that these implementations are not synchronized.

  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractStorelessUnivariateStatistic()  
  • Method Summary

    Modifier and Type Method Description
    abstract void clear()
    Clears the internal state of the Statistic
    abstract StorelessUnivariateStatistic copy()
    Returns a copy of the statistic with the same internal state.
    boolean equals​(java.lang.Object object)
    Returns true iff object is the same type of StorelessUnivariateStatistic (the object's class equals this instance) returning the same values as this for getResult() and getN().
    double evaluate​(double[] values)
    This default implementation creates a copy of this StorelessUnivariateStatistic instance, calls clear() on it, then calls incrementAll(double[]) with the specified portion of the input array, and then uses getResult() to compute the return value.
    double evaluate​(double[] values, int begin, int length)
    This default implementation creates a copy of this StorelessUnivariateStatistic instance, calls clear() on it, then calls incrementAll(double[]) with the specified portion of the input array, and then uses getResult() to compute the return value.
    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.
    void incrementAll​(double[] values)
    This default implementation just calls increment(double) in a loop over the input array.
    void incrementAll​(double[] values, int begin, int length)
    This default implementation just calls increment(double) in a loop over the specified portion of the input array.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.commons.math4.stat.descriptive.StorelessUnivariateStatistic

    getN