Package org.jfree.data.statistics
Class DefaultStatisticalCategoryDataset
java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.statistics.DefaultStatisticalCategoryDataset
- All Implemented Interfaces:
ObjectInputValidation
,Serializable
,Cloneable
,PublicCloneable
,CategoryDataset
,Dataset
,KeyedValues2D
,RangeInfo
,StatisticalCategoryDataset
,Values2D
public class DefaultStatisticalCategoryDataset extends AbstractDataset implements StatisticalCategoryDataset, RangeInfo, PublicCloneable
A convenience class that provides a default implementation of the
StatisticalCategoryDataset
interface.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description DefaultStatisticalCategoryDataset()
Creates a new dataset. -
Method Summary
Modifier and Type Method Description void
add(double mean, double standardDeviation, Comparable rowKey, Comparable columnKey)
Adds a mean and standard deviation to the table.void
add(Number mean, Number standardDeviation, Comparable rowKey, Comparable columnKey)
Adds a mean and standard deviation to the table.void
clear()
Clears all data from the dataset and sends aDatasetChangeEvent
to all registered listeners.Object
clone()
Returns a clone of this dataset.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(int row, int column)
Returns the mean value for an item.Number
getMeanValue(Comparable rowKey, Comparable columnKey)
Returns the mean value for an item.Range
getRangeBounds(boolean includeInterval)
Returns the bounds of the values in this dataset's y-values.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(int row, int column)
Returns the standard deviation value for an item.Number
getStdDevValue(Comparable rowKey, Comparable columnKey)
Returns the standard deviation value for an item.Number
getValue(int row, int column)
Returns the value for an item (for this dataset, the mean value is returned).Number
getValue(Comparable rowKey, Comparable columnKey)
Returns the value for an item (for this dataset, the mean value is returned).void
remove(Comparable rowKey, Comparable columnKey)
Removes an item from the dataset and sends aDatasetChangeEvent
to all registered listeners.void
removeColumn(int columnIndex)
Removes a column from the dataset and sends aDatasetChangeEvent
to all registered listeners.void
removeColumn(Comparable columnKey)
Removes a column from the dataset and sends aDatasetChangeEvent
to all registered listeners.void
removeRow(int rowIndex)
Removes a row from the dataset and sends aDatasetChangeEvent
to all registered listeners.void
removeRow(Comparable rowKey)
Removes a row from the dataset and sends aDatasetChangeEvent
to all registered listeners.Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObject
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Constructor Details
-
DefaultStatisticalCategoryDataset
public DefaultStatisticalCategoryDataset()Creates a new dataset.
-
-
Method Details
-
getMeanValue
Returns the mean value for an item.- Specified by:
getMeanValue
in interfaceStatisticalCategoryDataset
- Parameters:
row
- the row index (zero-based).column
- the column index (zero-based).- Returns:
- The mean value (possibly
null
).
-
getValue
Returns the value for an item (for this dataset, the mean value is returned). -
getValue
Returns the value for an item (for this dataset, the mean value is returned).- Specified by:
getValue
in interfaceKeyedValues2D
- Parameters:
rowKey
- the row key.columnKey
- the columnKey.- Returns:
- The value (possibly
null
).
-
getMeanValue
Returns the mean value for an item.- Specified by:
getMeanValue
in interfaceStatisticalCategoryDataset
- Parameters:
rowKey
- the row key.columnKey
- the columnKey.- Returns:
- The mean value (possibly
null
).
-
getStdDevValue
Returns the standard deviation value for an item.- Specified by:
getStdDevValue
in interfaceStatisticalCategoryDataset
- Parameters:
row
- the row index (zero-based).column
- the column index (zero-based).- Returns:
- The standard deviation (possibly
null
).
-
getStdDevValue
Returns the standard deviation value for an item.- Specified by:
getStdDevValue
in interfaceStatisticalCategoryDataset
- Parameters:
rowKey
- the row key.columnKey
- the columnKey.- Returns:
- The standard deviation (possibly
null
).
-
getColumnIndex
Returns the column index for a given key.- Specified by:
getColumnIndex
in interfaceKeyedValues2D
- Parameters:
key
- the column key (null
not permitted).- Returns:
- The column index.
-
getColumnKey
Returns a column key.- Specified by:
getColumnKey
in interfaceKeyedValues2D
- Parameters:
column
- the column index (zero-based).- Returns:
- The column key.
-
getColumnKeys
Returns the column keys.- Specified by:
getColumnKeys
in interfaceKeyedValues2D
- Returns:
- The keys.
-
getRowIndex
Returns the row index for a given key.- Specified by:
getRowIndex
in interfaceKeyedValues2D
- Parameters:
key
- the row key (null
not permitted).- Returns:
- The row index.
-
getRowKey
Returns a row key.- Specified by:
getRowKey
in interfaceKeyedValues2D
- Parameters:
row
- the row index (zero-based).- Returns:
- The row key.
-
getRowKeys
Returns the row keys.- Specified by:
getRowKeys
in interfaceKeyedValues2D
- Returns:
- The keys.
-
getRowCount
Returns the number of rows in the table.- Specified by:
getRowCount
in interfaceValues2D
- Returns:
- The row count.
- See Also:
getColumnCount()
-
getColumnCount
Returns the number of columns in the table.- Specified by:
getColumnCount
in interfaceValues2D
- Returns:
- The column count.
- See Also:
getRowCount()
-
add
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
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.
-
remove
Removes an item from the dataset and sends aDatasetChangeEvent
to all registered listeners.- Parameters:
rowKey
- the row key (null
not permitted).columnKey
- the column key (null
not permitted).- See Also:
add(double, double, Comparable, Comparable)
-
removeRow
Removes a row from the dataset and sends aDatasetChangeEvent
to all registered listeners.- Parameters:
rowIndex
- the row index.- See Also:
removeColumn(int)
-
removeRow
Removes a row from the dataset and sends aDatasetChangeEvent
to all registered listeners.- Parameters:
rowKey
- the row key (null
not permitted).- See Also:
removeColumn(Comparable)
-
removeColumn
Removes a column from the dataset and sends aDatasetChangeEvent
to all registered listeners.- Parameters:
columnIndex
- the column index.- See Also:
removeRow(int)
-
removeColumn
Removes a column from the dataset and sends aDatasetChangeEvent
to all registered listeners.- Parameters:
columnKey
- the column key (null
not permitted).- See Also:
removeRow(Comparable)
-
clear
Clears all data from the dataset and sends aDatasetChangeEvent
to all registered listeners. -
getRangeLowerBound
Returns the minimum y-value in the dataset.- Specified by:
getRangeLowerBound
in interfaceRangeInfo
- Parameters:
includeInterval
- a flag that determines whether or not the y-interval is taken into account.- Returns:
- The minimum value.
- See Also:
getRangeUpperBound(boolean)
-
getRangeUpperBound
Returns the maximum y-value in the dataset.- Specified by:
getRangeUpperBound
in interfaceRangeInfo
- Parameters:
includeInterval
- a flag that determines whether or not the y-interval is taken into account.- Returns:
- The maximum value.
- See Also:
getRangeLowerBound(boolean)
-
getRangeBounds
Returns the bounds of the values in this dataset's y-values.- Specified by:
getRangeBounds
in interfaceRangeInfo
- Parameters:
includeInterval
- a flag that determines whether or not the y-interval is taken into account.- Returns:
- The range.
-
equals
Tests this instance for equality with an arbitrary object. -
clone
Returns a clone of this dataset.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classAbstractDataset
- Returns:
- A clone of this dataset.
- Throws:
CloneNotSupportedException
- if cloning cannot be completed.
-