Rio Project 4.2 API Documentation



org.rioproject.watch
Class Accumulator

java.lang.Object
  extended by org.rioproject.watch.Accumulator

public class Accumulator
extends Object

The Accumulator represents a collection of Calculable objects and performs statistical analysis across the collection of Calculable objects, providing mean, median and standard deviation

Author:
Dennis Reedy

Constructor Summary
Accumulator(WatchDataSource source)
          Creates new Accumulator
 
Method Summary
 int count()
          Get the count of the current set of values
 Calculable[] getCalcs()
           
 WatchDataSource getSource()
          Getter for property source.
 void init()
          Initialize the range of values for calculating statistics
 double max()
          Get the max value of the current set of values
 double mean()
          Get the mean of the current set of values
 double median()
          Get the median of the current set of values
 double min()
          Get the min of the current set of values
 double mode()
          Get the mode of the current set of values
 int modeCount()
          Get the number of occurrences of the mode in the current set of values
 double range()
          Get the range of the current set of values
 void reset()
          Clears the current set of values
 void setSource(WatchDataSource source)
          Setter for property source.
 double standardDeviation()
          Get the standard deviation of the current set of values
 double sum()
          Get the sum of the current set of values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Accumulator

public Accumulator(WatchDataSource source)
Creates new Accumulator

Parameters:
source - The WatchDataSource the Accumulator will use
Method Detail

getCalcs

public Calculable[] getCalcs()

reset

public void reset()
Clears the current set of values


init

public void init()
          throws RemoteException
Initialize the range of values for calculating statistics

Throws:
RemoteException - If communication errors happen interfacing with the WatchDataSource

count

public int count()
Get the count of the current set of values

Returns:
int the total number of values

max

public double max()
Get the max value of the current set of values

Returns:
double the max of values

mean

public double mean()
Get the mean of the current set of values

Returns:
double the mean of the values

median

public double median()
Get the median of the current set of values

Returns:
double the median of the values

min

public double min()
Get the min of the current set of values

Returns:
double the min of the values

mode

public double mode()
Get the mode of the current set of values

Returns:
double the mode of the values

modeCount

public int modeCount()
Get the number of occurrences of the mode in the current set of values

Returns:
int the mode count

range

public double range()
Get the range of the current set of values

Returns:
double the range of the values

standardDeviation

public double standardDeviation()
Get the standard deviation of the current set of values

Returns:
double the standard deviation of the values

sum

public double sum()
Get the sum of the current set of values

Returns:
double the sum of the values

getSource

public WatchDataSource getSource()
Getter for property source.

Returns:
Value of property source.

setSource

public void setSource(WatchDataSource source)
Setter for property source.

Parameters:
source - New value of property source.

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.