net.aerith.misao.util
Class Statistics

java.lang.Object
  |
  +--net.aerith.misao.util.Statistics
Direct Known Subclasses:
HighOrderStatistics

public class Statistics
extends java.lang.Object

The Statistics represents statistics such as the minimum value, maximum value, average, etc., which are obtained in order O(n).


Field Summary
protected  double average
          The average;
protected  int data_count
          The number of data.
protected  double deviation
          The standard deviation.
protected  double maximum
          The maximum value;
protected  java.lang.Double maximum_limit
          The maximum value to use in calculation.
protected  double minimum
          The minimum value;
protected  java.lang.Double minimum_limit
          The minimum value to use in calculation.
protected  Statisticable target
          The target to calculate the statistics.
 
Constructor Summary
Statistics(Statisticable target)
          Constructs a Statistics with a Statisticable.
 
Method Summary
 void calculate()
          Calculates the statistics of the target.
 double getAverage()
          Gets the average value.
 double getDeviation()
          Gets the standard deviation value.
 double getMax()
          Gets the maximum value.
 double getMin()
          Gets the minimum value.
 java.lang.String getOutputString()
          Returns a string representation of the state of this object.
 double getVariance()
          Gets the variance value.
protected  java.lang.String paramString()
          Returns a raw string representation of the state of this object, for debugging use.
 void setMaximumLimit(double value)
          Sets the maximum limit of value to use in calculation.
 void setMinimumLimit(double value)
          Sets the minimum limit of value to use in calculation.
 java.lang.String toString()
          Returns a string representation of the state of this object, for debugging use.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

target

protected Statisticable target
The target to calculate the statistics.

data_count

protected int data_count
The number of data.

minimum

protected double minimum
The minimum value;

maximum

protected double maximum
The maximum value;

average

protected double average
The average;

deviation

protected double deviation
The standard deviation.

minimum_limit

protected java.lang.Double minimum_limit
The minimum value to use in calculation.

maximum_limit

protected java.lang.Double maximum_limit
The maximum value to use in calculation.
Constructor Detail

Statistics

public Statistics(Statisticable target)
Constructs a Statistics with a Statisticable.
Parameters:
target - the target to calculate the statistics.
Method Detail

setMinimumLimit

public void setMinimumLimit(double value)
Sets the minimum limit of value to use in calculation.
Parameters:
value - the minimum limit.

setMaximumLimit

public void setMaximumLimit(double value)
Sets the maximum limit of value to use in calculation.
Parameters:
value - the maximum limit.

calculate

public void calculate()
Calculates the statistics of the target.

getMin

public double getMin()
Gets the minimum value.
Returns:
the minimum value.

getMax

public double getMax()
Gets the maximum value.
Returns:
the maximum value.

getAverage

public double getAverage()
Gets the average value.
Returns:
the average value.

getDeviation

public double getDeviation()
Gets the standard deviation value.
Returns:
the standard deviation value.

getVariance

public double getVariance()
Gets the variance value.
Returns:
the variance value.

getOutputString

public java.lang.String getOutputString()
Returns a string representation of the state of this object.
Returns:
a string representation of the state of this object.

paramString

protected java.lang.String paramString()
Returns a raw string representation of the state of this object, for debugging use. It should be invoked from toString method of the subclasses.
Returns:
a string representation of the state of this object.

toString

public java.lang.String toString()
Returns a string representation of the state of this object, for debugging use.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the state of this object.