org.apache.commons.math.stat
Class AbstractUnivariateStatistic
java.lang.Object
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
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 |
AbstractUnivariateStatistic
public AbstractUnivariateStatistic()
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.
- returns
true
iff the parameters designate a subarray of
positive length
- throws
IllegalArgumentException
if the array is null or
or the indices are invalid
- returns
false
if the array is non-null, but
length
is 0.
- Parameters:
values
- the input arraybegin
- index of the first array element to includelength
- 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.