|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ucsb.nmsl.tools.BaseStatistic edu.ucsb.nmsl.tools.DataSetStatistic
public class DataSetStatistic
This class represents a statistic that represents a set of statistical information. Using a set of statistics allows for the calculation of an average, median, mode and standard deviation, all of which are not possible using the StatisticalPackage class.
The purpose of this class is to facilitate the research associated with the creation of the system and is not needed in the normal operation of AutoCap. Only the displayString method is overloaded withing the definition.
Field Summary | |
---|---|
protected java.util.LinkedList |
Data
A linked list containing all the data in the data set. |
protected double |
Sum
A running sum of all the data in the data set. |
protected double |
Var
A running variance of all the data in the data set. |
Fields inherited from class edu.ucsb.nmsl.tools.BaseStatistic |
---|
Name, Value |
Constructor Summary | |
---|---|
DataSetStatistic(java.lang.String name)
This contructor builds a DataSetStatistic instance with the name specified by "name" with an empty data set. |
|
DataSetStatistic(java.lang.String name,
java.util.Collection c)
This constructor creates a DataSetStatistic with a given name and with data from the specified collection. |
Method Summary | |
---|---|
void |
addDataPoint(double x)
This method adds a data point to the set. |
java.lang.String |
displayString()
This method returns a string that can be used to neatly show the statistical information associated with this particular instance. |
double |
getMean()
This method returns the mean of all data points in the set. |
double |
getMedian()
This method calculates and returns the median value of the data points in the set. |
double |
getMode()
This method returns the mode of all the data points in the set. |
double |
getStdDev()
This method calculates are returns the standard deviation of all the data in the set. |
static void |
main(java.lang.String[] args)
This method is meant for testing purposes and is not call in the operation of AutoCap. |
void |
removeDataPoint(double x)
This method removes a data point from the set. |
Methods inherited from class edu.ucsb.nmsl.tools.BaseStatistic |
---|
equals, getName, getValue, setName, setValue |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.LinkedList Data
protected double Sum
protected double Var
Constructor Detail |
---|
public DataSetStatistic(java.lang.String name, java.util.Collection c)
name
- The name associated with the instance.c
- A collection of data that becomes the data points in the data set.public DataSetStatistic(java.lang.String name)
name
- The name of the DataSetStatisic.Method Detail |
---|
public void addDataPoint(double x)
x
- The data point to be added to the data set.public void removeDataPoint(double x)
x
- The value of the data point to be removed.public double getStdDev()
public double getMean()
public double getMedian()
public double getMode()
public java.lang.String displayString()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |