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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate KeyedObjects2DStorage for the data.private doubleThe maximum range value.private intThe column index for the maximum range value.private doubleThe maximum range value including the standard deviation.private intThe column index for the maximum range value (including the standard deviation).private intThe row index for the maximum range value (including the standard deviation).private intThe row index for the maximum range value.private doubleThe minimum range value.private intThe column index for the minimum range value.private doubleThe minimum range value including the standard deviation.private intThe column index for the minimum range value (including the standard deviation).private intThe row index for the minimum range value (including the standard deviation).private intThe row index for the minimum range value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double mean, double standardDeviation, Comparable rowKey, Comparable columnKey) Adds a mean and standard deviation to the table.voidadd(Number mean, Number standardDeviation, Comparable rowKey, Comparable columnKey) Adds a mean and standard deviation to the table.voidclear()Clears all data from the dataset and sends aDatasetChangeEventto all registered listeners.clone()Returns a clone of this dataset.booleanTests this instance for equality with an arbitrary object.intReturns the number of columns in the table.intgetColumnIndex(Comparable key) Returns the column index for a given key.getColumnKey(int column) Returns a column key.Returns the column keys.getMeanValue(int row, int column) Returns the mean value for an item.getMeanValue(Comparable rowKey, Comparable columnKey) Returns the mean value for an item.getRangeBounds(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.intReturns the number of rows in the table.intgetRowIndex(Comparable key) Returns the row index for a given key.getRowKey(int row) Returns a row key.Returns the row keys.getStdDevValue(int row, int column) Returns the standard deviation value for an item.getStdDevValue(Comparable rowKey, Comparable columnKey) Returns the standard deviation value for an item.getValue(int row, int column) Returns the value for an item (for this dataset, the mean value is returned).getValue(Comparable rowKey, Comparable columnKey) Returns the value for an item (for this dataset, the mean value is returned).voidremove(Comparable rowKey, 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(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(Comparable rowKey) Removes a row from the dataset and sends aDatasetChangeEventto all registered listeners.private voidIterate 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, validateObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Field Details
-
data
Storage for the data. -
minimumRangeValue
private double minimumRangeValueThe minimum range value. -
minimumRangeValueRow
private int minimumRangeValueRowThe row index for the minimum range value. -
minimumRangeValueColumn
private int minimumRangeValueColumnThe column index for the minimum range value. -
minimumRangeValueIncStdDev
private double minimumRangeValueIncStdDevThe minimum range value including the standard deviation. -
minimumRangeValueIncStdDevRow
private int minimumRangeValueIncStdDevRowThe row index for the minimum range value (including the standard deviation). -
minimumRangeValueIncStdDevColumn
private int minimumRangeValueIncStdDevColumnThe column index for the minimum range value (including the standard deviation). -
maximumRangeValue
private double maximumRangeValueThe maximum range value. -
maximumRangeValueRow
private int maximumRangeValueRowThe row index for the maximum range value. -
maximumRangeValueColumn
private int maximumRangeValueColumnThe column index for the maximum range value. -
maximumRangeValueIncStdDev
private double maximumRangeValueIncStdDevThe maximum range value including the standard deviation. -
maximumRangeValueIncStdDevRow
private int maximumRangeValueIncStdDevRowThe row index for the maximum range value (including the standard deviation). -
maximumRangeValueIncStdDevColumn
private int maximumRangeValueIncStdDevColumnThe column index for the maximum range value (including the standard deviation).
-
-
Constructor Details
-
DefaultStatisticalCategoryDataset
public DefaultStatisticalCategoryDataset()Creates a new dataset.
-
-
Method Details
-
getMeanValue
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
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:
getValuein interfaceKeyedValues2D- Parameters:
rowKey- the row key.columnKey- the columnKey.- Returns:
- The value (possibly
null).
-
getMeanValue
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
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
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
Returns the column index for a given key.- Specified by:
getColumnIndexin interfaceKeyedValues2D- Parameters:
key- the column key (nullnot permitted).- Returns:
- The column index.
-
getColumnKey
Returns a column key.- Specified by:
getColumnKeyin interfaceKeyedValues2D- Parameters:
column- the column index (zero-based).- Returns:
- The column key.
-
getColumnKeys
Returns the column keys.- Specified by:
getColumnKeysin interfaceKeyedValues2D- Returns:
- The keys.
-
getRowIndex
Returns the row index for a given key.- Specified by:
getRowIndexin interfaceKeyedValues2D- Parameters:
key- the row key (nullnot permitted).- Returns:
- The row index.
-
getRowKey
Returns a row key.- Specified by:
getRowKeyin interfaceKeyedValues2D- Parameters:
row- the row index (zero-based).- Returns:
- The row key.
-
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
public int getColumnCount()Returns the number of columns in the table.- Specified by:
getColumnCountin interfaceValues2D- Returns:
- The column count.
- See Also:
-
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 aDatasetChangeEventto all registered listeners.- Parameters:
rowKey- the row key (nullnot permitted).columnKey- the column key (nullnot permitted).- See Also:
-
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:
-
removeRow
Removes a row from the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
rowKey- the row key (nullnot permitted).- See Also:
-
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:
-
removeColumn
Removes a column from the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
columnKey- the column key (nullnot permitted).- See Also:
-
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
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:
-
getRangeBounds
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
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classAbstractDataset- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
Returns a clone of this dataset.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- A clone of this dataset.
- Throws:
CloneNotSupportedException- if cloning cannot be completed.
-