org.apache.commons.math.stat.univariate
Class AbstractStorelessUnivariateStatistic

java.lang.Object
  extended byorg.apache.commons.math.stat.univariate.AbstractUnivariateStatistic
      extended byorg.apache.commons.math.stat.univariate.AbstractStorelessUnivariateStatistic
All Implemented Interfaces:
StorelessUnivariateStatistic, UnivariateStatistic
Direct Known Subclasses:
FirstMoment, Kurtosis, Max, Mean, Min, Product, Skewness, Sum, SumOfLogs, SumOfSquares, Variance

public abstract class AbstractStorelessUnivariateStatistic
extends AbstractUnivariateStatistic
implements StorelessUnivariateStatistic

Abstract Implementation for StorelessUnivariateStatistics. Provides the ability to extend polymophically so that indiviual statistics do not need to implement these methods unless there are better algorithms for handling the calculation.

Version:
$Revision: 1.11 $ $Date: 2003/11/14 22:22:21 $

Constructor Summary
AbstractStorelessUnivariateStatistic()
           
 
Method Summary
abstract  void clear()
          Clears all the internal state of the Statistic
 double evaluate(double[] values, int begin, int length)
          This implements the AbstractUnivariateStatistic impl to funnel calculation off to the instantanious increment method.
abstract  double getResult()
          Returns the current state of the statistic after the last increment.
abstract  void increment(double d)
          Increments the internal state of the Storagless Implementation.
 
Methods inherited from class org.apache.commons.math.stat.univariate.AbstractUnivariateStatistic
evaluate, test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.math.stat.univariate.StorelessUnivariateStatistic
getN
 
Methods inherited from interface org.apache.commons.math.stat.univariate.UnivariateStatistic
evaluate
 

Constructor Detail

AbstractStorelessUnivariateStatistic

public AbstractStorelessUnivariateStatistic()
Method Detail

evaluate

public double evaluate(double[] values,
                       int begin,
                       int length)
This implements the AbstractUnivariateStatistic impl to funnel calculation off to the instantanious increment method. In most cases of StorelessUnivariateStatistic this is never really used because more efficient algorithms are available for that statistic.

Specified by:
evaluate in interface UnivariateStatistic
Specified by:
evaluate in class AbstractUnivariateStatistic
See Also:
UnivariateStatistic.evaluate(double[], int, int)

clear

public abstract void clear()
Description copied from interface: StorelessUnivariateStatistic
Clears all the internal state of the Statistic

Specified by:
clear in interface StorelessUnivariateStatistic
See Also:
StorelessUnivariateStatistic.clear()

getResult

public abstract double getResult()
Description copied from interface: StorelessUnivariateStatistic
Returns the current state of the statistic after the last increment.

Specified by:
getResult in interface StorelessUnivariateStatistic
Returns:
value of the statistic, Double.NaN if it has been cleared or just instantiated.
See Also:
StorelessUnivariateStatistic.getResult()

increment

public abstract void increment(double d)
Description copied from interface: StorelessUnivariateStatistic
Increments the internal state of the Storagless Implementation.

Specified by:
increment in interface StorelessUnivariateStatistic
Parameters:
d - is the value to increment the state by.
See Also:
StorelessUnivariateStatistic.increment(double)


Copyright © 2003-2004 Apache Software Foundation. All Rights Reserved.