Class DataSet

java.lang.Object
  extended by DataSet

public class DataSet
extends java.lang.Object

Computes the average of a set of data values.


Constructor Summary
DataSet()
          Constructs an empty data set.
 
Method Summary
 void add(Measurable x)
          Adds a data value to the data set.
 double getAverage()
          Gets the average of the added data.
 Measurable getMaximum()
          Gets the largest of the added data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSet

public DataSet()
Constructs an empty data set.

Method Detail

add

public void add(Measurable x)
Adds a data value to the data set.

Parameters:
x - a data value

getAverage

public double getAverage()
Gets the average of the added data.

Returns:
the average or 0 if no data has been added

getMaximum

public Measurable getMaximum()
Gets the largest of the added data.

Returns:
the maximum or 0 if no data has been added