org.apache.commons.math.stat
Class AbstractUnivariateStatistic

java.lang.Object
  extended by org.apache.commons.math.stat.AbstractUnivariateStatistic
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Percentile

public abstract class AbstractUnivariateStatistic
extends java.lang.Object
implements java.io.Serializable

Abstract base class for all implementations of the UnivariateStatistic interface.

Provides a default implementation of evaluate(double[]), delegating to evaluate(double[], int, int) in the natural way.

Also includes a test method that performs generic parameter validation for the evaluate methods.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
AbstractUnivariateStatistic()
           
 
Method Summary
 double evaluate(double[] values)
           
abstract  double evaluate(double[] values, int begin, int length)
           
protected  boolean test(double[] values, int begin, int length)
          This method is used by evaluate(double[], int, int) methods to verify that the input parameters designate a subarray of positive length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractUnivariateStatistic

public AbstractUnivariateStatistic()
Method Detail

evaluate

public double evaluate(double[] values)
See Also:
org.apache.commons.math.stat.descriptive.UnivariateStatistic#evaluate(double[])

evaluate

public abstract double evaluate(double[] values,
                                int begin,
                                int length)
See Also:
org.apache.commons.math.stat.descriptive.UnivariateStatistic#evaluate(double[], int, int)

test

protected boolean test(double[] values,
                       int begin,
                       int length)
This method is used by evaluate(double[], int, int) methods to verify that the input parameters designate a subarray of positive length.

Parameters:
values - the input array
begin - index of the first array element to include
length - the number of elements to include
Returns:
true if the parameters are valid and designate a subarray of positive length
Throws:
java.lang.IllegalArgumentException - if the indices are invalid or the array is null


Copyright © 2007-2011 - Thomas Abeel - All Rights Reserved. SourceForge.netLogo