org.apache.commons.math.stat.descriptive
Class ListUnivariateImpl

java.lang.Object
  extended by org.apache.commons.math.stat.descriptive.DescriptiveStatistics
      extended by org.apache.commons.math.stat.descriptive.ListUnivariateImpl
All Implemented Interfaces:
Serializable, org.apache.commons.math.stat.descriptive.StatisticalSummary

public class ListUnivariateImpl
extends org.apache.commons.math.stat.descriptive.DescriptiveStatistics
implements Serializable

Version:
$Revision: 762087 $ $Date: 2009-04-05 10:20:18 -0400 (Sun, 05 Apr 2009) $
See Also:
Serialized Form

Field Summary
protected  List<Object> list
          Holds a reference to a list - GENERICs are going to make our lives easier here as we could only accept List
protected  org.apache.commons.math.util.NumberTransformer transformer
          Number Transformer maps Objects to Number for us.
 
Fields inherited from class org.apache.commons.math.stat.descriptive.DescriptiveStatistics
eDA, INFINITE_WINDOW, windowSize
 
Constructor Summary
ListUnivariateImpl()
          No argument Constructor
ListUnivariateImpl(List<Object> list)
          Construct a ListUnivariate with a specific List.
ListUnivariateImpl(List<Object> list, org.apache.commons.math.util.NumberTransformer transformer)
          Construct a ListUnivariate with a specific List.
 
Method Summary
 void addObject(Object o)
          Adds an object to this list.
 void addValue(double v)
          
 double apply(org.apache.commons.math.stat.descriptive.UnivariateStatistic stat)
          Apply the given statistic to this univariate collection.
 void clear()
          Clears all statistics.
 double getElement(int index)
          
 long getN()
          
 org.apache.commons.math.util.NumberTransformer getTransformer()
          Access the number transformer.
 double[] getValues()
          
 int getWindowSize()
          
 void setTransformer(org.apache.commons.math.util.NumberTransformer transformer)
          Modify the number transformer.
 void setWindowSize(int windowSize)
          
 
Methods inherited from class org.apache.commons.math.stat.descriptive.DescriptiveStatistics
copy, copy, getGeometricMean, getGeometricMeanImpl, getKurtosis, getKurtosisImpl, getMax, getMaxImpl, getMean, getMeanImpl, getMin, getMinImpl, getPercentile, getPercentileImpl, getSkewness, getSkewnessImpl, getSortedValues, getStandardDeviation, getSum, getSumImpl, getSumsq, getSumsqImpl, getVariance, getVarianceImpl, removeMostRecentValue, replaceMostRecentValue, setGeometricMeanImpl, setKurtosisImpl, setMaxImpl, setMeanImpl, setMinImpl, setPercentileImpl, setSkewnessImpl, setSumImpl, setSumsqImpl, setVarianceImpl, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

list

protected List<Object> list
Holds a reference to a list - GENERICs are going to make our lives easier here as we could only accept List


transformer

protected org.apache.commons.math.util.NumberTransformer transformer
Number Transformer maps Objects to Number for us.

Constructor Detail

ListUnivariateImpl

public ListUnivariateImpl()
No argument Constructor


ListUnivariateImpl

public ListUnivariateImpl(List<Object> list)
Construct a ListUnivariate with a specific List.

Parameters:
list - The list that will back this DescriptiveStatistics

ListUnivariateImpl

public ListUnivariateImpl(List<Object> list,
                          org.apache.commons.math.util.NumberTransformer transformer)
Construct a ListUnivariate with a specific List.

Parameters:
list - The list that will back this DescriptiveStatistics
transformer - the number transformer used to convert the list items.
Method Detail

getValues

public double[] getValues()

Overrides:
getValues in class org.apache.commons.math.stat.descriptive.DescriptiveStatistics

getElement

public double getElement(int index)

Overrides:
getElement in class org.apache.commons.math.stat.descriptive.DescriptiveStatistics

getN

public long getN()

Specified by:
getN in interface org.apache.commons.math.stat.descriptive.StatisticalSummary
Overrides:
getN in class org.apache.commons.math.stat.descriptive.DescriptiveStatistics

addValue

public void addValue(double v)

Overrides:
addValue in class org.apache.commons.math.stat.descriptive.DescriptiveStatistics

addObject

public void addObject(Object o)
Adds an object to this list.

Parameters:
o - Object to add to the list

clear

public void clear()
Clears all statistics.

N.B.: This method has the side effect of clearing the underlying list.

Overrides:
clear in class org.apache.commons.math.stat.descriptive.DescriptiveStatistics

apply

public double apply(org.apache.commons.math.stat.descriptive.UnivariateStatistic stat)
Apply the given statistic to this univariate collection.

Overrides:
apply in class org.apache.commons.math.stat.descriptive.DescriptiveStatistics
Parameters:
stat - the statistic to apply
Returns:
the computed value of the statistic.

getTransformer

public org.apache.commons.math.util.NumberTransformer getTransformer()
Access the number transformer.

Returns:
the number transformer.

setTransformer

public void setTransformer(org.apache.commons.math.util.NumberTransformer transformer)
Modify the number transformer.

Parameters:
transformer - the new number transformer.

setWindowSize

public void setWindowSize(int windowSize)

Overrides:
setWindowSize in class org.apache.commons.math.stat.descriptive.DescriptiveStatistics

getWindowSize

public int getWindowSize()

Overrides:
getWindowSize in class org.apache.commons.math.stat.descriptive.DescriptiveStatistics


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