Package org.jfree.data.statistics
Class DefaultStatisticalCategoryDataset
- java.lang.Object
-
- org.jfree.data.general.AbstractDataset
-
- org.jfree.data.statistics.DefaultStatisticalCategoryDataset
-
- All Implemented Interfaces:
java.io.ObjectInputValidation,java.io.Serializable,java.lang.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 theStatisticalCategoryDatasetinterface.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private KeyedObjects2DdataStorage for the data.private doublemaximumRangeValueThe maximum range value.private intmaximumRangeValueColumnThe column index for the maximum range value.private doublemaximumRangeValueIncStdDevThe maximum range value including the standard deviation.private intmaximumRangeValueIncStdDevColumnThe column index for the maximum range value (including the standard deviation).private intmaximumRangeValueIncStdDevRowThe row index for the maximum range value (including the standard deviation).private intmaximumRangeValueRowThe row index for the maximum range value.private doubleminimumRangeValueThe minimum range value.private intminimumRangeValueColumnThe column index for the minimum range value.private doubleminimumRangeValueIncStdDevThe minimum range value including the standard deviation.private intminimumRangeValueIncStdDevColumnThe column index for the minimum range value (including the standard deviation).private intminimumRangeValueIncStdDevRowThe row index for the minimum range value (including the standard deviation).private intminimumRangeValueRowThe row index for the minimum range value.
-
Constructor Summary
Constructors Constructor Description DefaultStatisticalCategoryDataset()Creates a new dataset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(double mean, double standardDeviation, java.lang.Comparable rowKey, java.lang.Comparable columnKey)Adds a mean and standard deviation to the table.voidadd(java.lang.Number mean, java.lang.Number standardDeviation, java.lang.Comparable rowKey, java.lang.Comparable columnKey)Adds a mean and standard deviation to the table.voidclear()Clears all data from the dataset and sends aDatasetChangeEventto all registered listeners.java.lang.Objectclone()Returns a clone of this dataset.booleanequals(java.lang.Object obj)Tests this instance for equality with an arbitrary object.intgetColumnCount()Returns the number of columns in the table.intgetColumnIndex(java.lang.Comparable key)Returns the column index for a given key.java.lang.ComparablegetColumnKey(int column)Returns a column key.java.util.ListgetColumnKeys()Returns the column keys.java.lang.NumbergetMeanValue(int row, int column)Returns the mean value for an item.java.lang.NumbergetMeanValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the mean value for an item.RangegetRangeBounds(boolean includeInterval)Returns the bounds of the values in this dataset's y-values.doublegetRangeLowerBound(boolean includeInterval)Returns the minimum y-value in the dataset.doublegetRangeUpperBound(boolean includeInterval)Returns the maximum y-value in the dataset.intgetRowCount()Returns the number of rows in the table.intgetRowIndex(java.lang.Comparable key)Returns the row index for a given key.java.lang.ComparablegetRowKey(int row)Returns a row key.java.util.ListgetRowKeys()Returns the row keys.java.lang.NumbergetStdDevValue(int row, int column)Returns the standard deviation value for an item.java.lang.NumbergetStdDevValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the standard deviation value for an item.java.lang.NumbergetValue(int row, int column)Returns the value for an item (for this dataset, the mean value is returned).java.lang.NumbergetValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the value for an item (for this dataset, the mean value is returned).voidremove(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Removes an item from the dataset and sends aDatasetChangeEventto all registered listeners.voidremoveColumn(int columnIndex)Removes a column from the dataset and sends aDatasetChangeEventto all registered listeners.voidremoveColumn(java.lang.Comparable columnKey)Removes a column from the dataset and sends aDatasetChangeEventto all registered listeners.voidremoveRow(int rowIndex)Removes a row from the dataset and sends aDatasetChangeEventto all registered listeners.voidremoveRow(java.lang.Comparable rowKey)Removes a row from the dataset and sends aDatasetChangeEventto all registered listeners.private voidupdateBounds()Iterate over all the data items and update the cached bound values.-
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, canEqual, fireDatasetChanged, getGroup, getNotify, hashCode, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObject
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
-
-
-
Field Detail
-
data
private KeyedObjects2D data
Storage for the data.
-
minimumRangeValue
private double minimumRangeValue
The minimum range value.
-
minimumRangeValueRow
private int minimumRangeValueRow
The row index for the minimum range value.
-
minimumRangeValueColumn
private int minimumRangeValueColumn
The column index for the minimum range value.
-
minimumRangeValueIncStdDev
private double minimumRangeValueIncStdDev
The minimum range value including the standard deviation.
-
minimumRangeValueIncStdDevRow
private int minimumRangeValueIncStdDevRow
The row index for the minimum range value (including the standard deviation).
-
minimumRangeValueIncStdDevColumn
private int minimumRangeValueIncStdDevColumn
The column index for the minimum range value (including the standard deviation).
-
maximumRangeValue
private double maximumRangeValue
The maximum range value.
-
maximumRangeValueRow
private int maximumRangeValueRow
The row index for the maximum range value.
-
maximumRangeValueColumn
private int maximumRangeValueColumn
The column index for the maximum range value.
-
maximumRangeValueIncStdDev
private double maximumRangeValueIncStdDev
The maximum range value including the standard deviation.
-
maximumRangeValueIncStdDevRow
private int maximumRangeValueIncStdDevRow
The row index for the maximum range value (including the standard deviation).
-
maximumRangeValueIncStdDevColumn
private int maximumRangeValueIncStdDevColumn
The column index for the maximum range value (including the standard deviation).
-
-
Method Detail
-
getMeanValue
public java.lang.Number getMeanValue(int row, int column)Returns the mean value for an item.- Specified by:
getMeanValuein interfaceStatisticalCategoryDataset- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The mean value (possibly
null).
-
getValue
public java.lang.Number getValue(int row, int column)Returns the value for an item (for this dataset, the mean value is returned).
-
getValue
public java.lang.Number getValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the value for an item (for this dataset, the mean value is returned).- Specified by:
getValuein interfaceKeyedValues2D- Parameters:
rowKey- the row key.columnKey- the columnKey.- Returns:
- The value (possibly
null).
-
getMeanValue
public java.lang.Number getMeanValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the mean value for an item.- Specified by:
getMeanValuein interfaceStatisticalCategoryDataset- Parameters:
rowKey- the row key.columnKey- the columnKey.- Returns:
- The mean value (possibly
null).
-
getStdDevValue
public java.lang.Number getStdDevValue(int row, int column)Returns the standard deviation value for an item.- Specified by:
getStdDevValuein interfaceStatisticalCategoryDataset- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The standard deviation (possibly
null).
-
getStdDevValue
public java.lang.Number getStdDevValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the standard deviation value for an item.- Specified by:
getStdDevValuein interfaceStatisticalCategoryDataset- Parameters:
rowKey- the row key.columnKey- the columnKey.- Returns:
- The standard deviation (possibly
null).
-
getColumnIndex
public int getColumnIndex(java.lang.Comparable key)
Returns the column index for a given key.- Specified by:
getColumnIndexin interfaceKeyedValues2D- Parameters:
key- the column key (nullnot permitted).- Returns:
- The column index.
-
getColumnKey
public java.lang.Comparable getColumnKey(int column)
Returns a column key.- Specified by:
getColumnKeyin interfaceKeyedValues2D- Parameters:
column- the column index (zero-based).- Returns:
- The column key.
-
getColumnKeys
public java.util.List getColumnKeys()
Returns the column keys.- Specified by:
getColumnKeysin interfaceKeyedValues2D- Returns:
- The keys.
-
getRowIndex
public int getRowIndex(java.lang.Comparable key)
Returns the row index for a given key.- Specified by:
getRowIndexin interfaceKeyedValues2D- Parameters:
key- the row key (nullnot permitted).- Returns:
- The row index.
-
getRowKey
public java.lang.Comparable getRowKey(int row)
Returns a row key.- Specified by:
getRowKeyin interfaceKeyedValues2D- Parameters:
row- the row index (zero-based).- Returns:
- The row key.
-
getRowKeys
public java.util.List getRowKeys()
Returns the row keys.- Specified by:
getRowKeysin interfaceKeyedValues2D- Returns:
- The keys.
-
getRowCount
public int getRowCount()
Returns the number of rows in the table.- Specified by:
getRowCountin interfaceValues2D- Returns:
- The row count.
- See Also:
getColumnCount()
-
getColumnCount
public int getColumnCount()
Returns the number of columns in the table.- Specified by:
getColumnCountin interfaceValues2D- Returns:
- The column count.
- See Also:
getRowCount()
-
add
public void add(double mean, double standardDeviation, java.lang.Comparable rowKey, java.lang.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(java.lang.Number mean, java.lang.Number standardDeviation, java.lang.Comparable rowKey, java.lang.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.
-
remove
public void remove(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Removes an item from the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
rowKey- the row key (nullnot permitted).columnKey- the column key (nullnot permitted).- See Also:
add(double, double, Comparable, Comparable)
-
removeRow
public void removeRow(int rowIndex)
Removes a row from the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
rowIndex- the row index.- See Also:
removeColumn(int)
-
removeRow
public void removeRow(java.lang.Comparable rowKey)
Removes a row from the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
rowKey- the row key (nullnot permitted).- See Also:
removeColumn(Comparable)
-
removeColumn
public void removeColumn(int columnIndex)
Removes a column from the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
columnIndex- the column index.- See Also:
removeRow(int)
-
removeColumn
public void removeColumn(java.lang.Comparable columnKey)
Removes a column from the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
columnKey- the column key (nullnot permitted).- See Also:
removeRow(Comparable)
-
clear
public void clear()
Clears all data from the dataset and sends aDatasetChangeEventto all registered listeners.
-
updateBounds
private void updateBounds()
Iterate over all the data items and update the cached bound values.
-
getRangeLowerBound
public double getRangeLowerBound(boolean includeInterval)
Returns the minimum y-value in the dataset.- Specified by:
getRangeLowerBoundin 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
public double getRangeUpperBound(boolean includeInterval)
Returns the maximum y-value in the dataset.- Specified by:
getRangeUpperBoundin 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
public Range getRangeBounds(boolean includeInterval)
Returns the bounds of the values in this dataset's y-values.- Specified by:
getRangeBoundsin interfaceRangeInfo- Parameters:
includeInterval- a flag that determines whether or not the y-interval is taken into account.- Returns:
- The range.
-
equals
public boolean equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classAbstractDataset- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of this dataset.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- A clone of this dataset.
- Throws:
java.lang.CloneNotSupportedException- if cloning cannot be completed.
-
-