org.jfree.data.statistics

Class DefaultStatisticalCategoryDataset

Implemented Interfaces:
CategoryDataset, Cloneable, Dataset, KeyedValues2D, ObjectInputValidation, RangeInfo, Serializable, StatisticalCategoryDataset, Values2D

public class DefaultStatisticalCategoryDataset
extends AbstractDataset
implements StatisticalCategoryDataset, RangeInfo

A convenience class that provides a default implementation of the StatisticalCategoryDataset interface.

Constructor Summary

DefaultStatisticalCategoryDataset()
Creates a new dataset.

Method Summary

void
add(Number mean, Number standardDeviation, Comparable rowKey, Comparable columnKey)
Adds a mean and standard deviation to the table.
void
add(double mean, double standardDeviation, Comparable rowKey, Comparable columnKey)
Adds a mean and standard deviation to the table.
boolean
equals(Object obj)
Tests this instance for equality with an arbitrary object.
int
getColumnCount()
Returns the number of columns in the table.
int
getColumnIndex(Comparable key)
Returns the column index for a given key.
Comparable
getColumnKey(int column)
Returns a column key.
List
getColumnKeys()
Returns the column keys.
Number
getMeanValue(Comparable rowKey, Comparable columnKey)
Returns the mean value for an item.
Number
getMeanValue(int row, int column)
Returns the mean value for an item.
Range
getRangeBounds(boolean includeInterval)
Returns the range of the values in this dataset's range.
double
getRangeLowerBound(boolean includeInterval)
Returns the minimum y-value in the dataset.
double
getRangeUpperBound(boolean includeInterval)
Returns the maximum y-value in the dataset.
int
getRowCount()
Returns the number of rows in the table.
int
getRowIndex(Comparable key)
Returns the row index for a given key.
Comparable
getRowKey(int row)
Returns a row key.
List
getRowKeys()
Returns the row keys.
Number
getStdDevValue(Comparable rowKey, Comparable columnKey)
Returns the standard deviation value for an item.
Number
getStdDevValue(int row, int column)
Returns the standard deviation value for an item.
Number
getValue(Comparable rowKey, Comparable columnKey)
Returns the value for an item (for this dataset, the mean value is returned).
Number
getValue(int row, int column)
Returns the value for an item (for this dataset, the mean value is returned).

Methods inherited from class org.jfree.data.general.AbstractDataset

addChangeListener, clone, fireDatasetChanged, getGroup, hasListener, notifyListeners, removeChangeListener, setGroup, validateObject

Constructor Details

DefaultStatisticalCategoryDataset

public DefaultStatisticalCategoryDataset()
Creates a new dataset.

Method Details

add

public void add(Number mean,
                Number standardDeviation,
                Comparable rowKey,
                Comparable columnKey)
Adds a mean and standard deviation to the table.
Parameters:
mean - the mean.
standardDeviation - the standard deviation.
rowKey - the row key.
columnKey - the column key.

add

public void add(double mean,
                double standardDeviation,
                Comparable rowKey,
                Comparable columnKey)
Adds a mean and standard deviation to the table.
Parameters:
mean - the mean.
standardDeviation - the standard deviation.
rowKey - the row key.
columnKey - the column key.

equals

public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

getColumnCount

public int getColumnCount()
Returns the number of columns in the table.
Specified by:
getColumnCount in interface Values2D
Returns:
The column count.

getColumnIndex

public int getColumnIndex(Comparable key)
Returns the column index for a given key.
Specified by:
getColumnIndex in interface KeyedValues2D
Parameters:
key - the column key.
Returns:
The column index.

getColumnKey

public Comparable getColumnKey(int column)
Returns a column key.
Specified by:
getColumnKey in interface KeyedValues2D
Parameters:
column - the column index (zero-based).
Returns:
The column key.

getColumnKeys

public List getColumnKeys()
Returns the column keys.
Specified by:
getColumnKeys in interface KeyedValues2D
Returns:
The keys.

getMeanValue

public Number getMeanValue(Comparable rowKey,
                           Comparable columnKey)
Returns the mean value for an item.
Specified by:
getMeanValue in interface StatisticalCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the columnKey.
Returns:
The mean value.

getMeanValue

public Number getMeanValue(int row,
                           int column)
Returns the mean value for an item.
Specified by:
getMeanValue in interface StatisticalCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
The mean value.

getRangeBounds

public Range getRangeBounds(boolean includeInterval)
Returns the range of the values in this dataset's range.
Specified by:
getRangeBounds in interface RangeInfo
Parameters:
includeInterval - a flag that determines whether or not the y-interval is taken into account.
Returns:
The range.

getRangeLowerBound

public double getRangeLowerBound(boolean includeInterval)
Returns the minimum y-value in the dataset.
Specified by:
getRangeLowerBound in interface RangeInfo
Parameters:
includeInterval - a flag that determines whether or not the y-interval is taken into account (ignored for this dataset).
Returns:
The minimum value.

getRangeUpperBound

public double getRangeUpperBound(boolean includeInterval)
Returns the maximum y-value in the dataset.
Specified by:
getRangeUpperBound in interface RangeInfo
Parameters:
includeInterval - a flag that determines whether or not the y-interval is taken into account (ignored for this dataset).
Returns:
The maximum value.

getRowCount

public int getRowCount()
Returns the number of rows in the table.
Specified by:
getRowCount in interface Values2D
Returns:
The row count.

getRowIndex

public int getRowIndex(Comparable key)
Returns the row index for a given key.
Specified by:
getRowIndex in interface KeyedValues2D
Parameters:
key - the row key.
Returns:
The row index.

getRowKey

public Comparable getRowKey(int row)
Returns a row key.
Specified by:
getRowKey in interface KeyedValues2D
Parameters:
row - the row index (zero-based).
Returns:
The row key.

getRowKeys

public List getRowKeys()
Returns the row keys.
Specified by:
getRowKeys in interface KeyedValues2D
Returns:
The keys.

getStdDevValue

public Number getStdDevValue(Comparable rowKey,
                             Comparable columnKey)
Returns the standard deviation value for an item.
Specified by:
getStdDevValue in interface StatisticalCategoryDataset
Parameters:
rowKey - the row key.
columnKey - the columnKey.
Returns:
The standard deviation.

getStdDevValue

public Number getStdDevValue(int row,
                             int column)
Returns the standard deviation value for an item.
Specified by:
getStdDevValue in interface StatisticalCategoryDataset
Parameters:
row - the row index (zero-based).
column - the column index (zero-based).
Returns:
The standard deviation.

getValue

public Number getValue(Comparable rowKey,
                       Comparable columnKey)
Returns the value for an item (for this dataset, the mean value is returned).
Specified by:
getValue in interface KeyedValues2D
Parameters:
rowKey - the row key.
columnKey - the columnKey.
Returns:
The value.

getValue

public Number getValue(int row,
                       int column)
Returns the value for an item (for this dataset, the mean value is returned).
Specified by:
getValue in interface Values2D
Parameters:
row - the row index.
column - the column index.
Returns:
The value.