Module org.jfree.chart
Package org.jfree.data.statistics
Class DefaultStatisticalCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>
- java.lang.Object
-
- org.jfree.data.general.AbstractDataset
-
- org.jfree.data.statistics.DefaultStatisticalCategoryDataset<R,C>
-
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,PublicCloneable,CategoryDataset<R,C>,Dataset,KeyedValues2D<R,C>,RangeInfo,StatisticalCategoryDataset<R,C>,Values2D
public class DefaultStatisticalCategoryDataset<R extends Comparable<R>,C extends Comparable<C>> extends AbstractDataset implements StatisticalCategoryDataset<R,C>, RangeInfo, PublicCloneable
A convenience class that provides a default implementation of theStatisticalCategoryDatasetinterface.- See Also:
- Serialized Form
-
-
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, R rowKey, C columnKey)Adds a mean and standard deviation to the table.voidadd(Number mean, Number standardDeviation, R rowKey, C columnKey)Adds a mean and standard deviation to the table.voidclear()Clears all data from the dataset and sends aDatasetChangeEventto all registered listeners.Objectclone()Returns a clone of this dataset.booleanequals(Object obj)Tests this instance for equality with an arbitrary object.intgetColumnCount()Returns the number of columns in the table.intgetColumnIndex(C key)Returns the column index for a given key.CgetColumnKey(int column)Returns a column key.List<C>getColumnKeys()Returns the column keys.NumbergetMeanValue(int row, int column)Returns the mean value for an item.NumbergetMeanValue(R rowKey, C 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(R key)Returns the row index for a given key.RgetRowKey(int row)Returns a row key.List<R>getRowKeys()Returns the row keys.NumbergetStdDevValue(int row, int column)Returns the standard deviation value for an item.NumbergetStdDevValue(R rowKey, C columnKey)Returns the standard deviation value for an item.NumbergetValue(int row, int column)Returns the value for an item (for this dataset, the mean value is returned).NumbergetValue(R rowKey, C columnKey)Returns the value for an item (for this dataset, the mean value is returned).inthashCode()voidremove(R rowKey, C 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(C 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(R rowKey)Removes a row from the dataset and sends aDatasetChangeEventto all registered listeners.-
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, fireDatasetChanged, getNotify, hasListener, notifyListeners, removeChangeListener, 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, removeChangeListener
-
-
-
-
Constructor Detail
-
DefaultStatisticalCategoryDataset
public DefaultStatisticalCategoryDataset()
Creates a new dataset.
-
-
Method Detail
-
getMeanValue
public Number getMeanValue(int row, int column)
Returns the mean value for an item.- Specified by:
getMeanValuein interfaceStatisticalCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The mean value (possibly
null).
-
getValue
public Number getValue(int row, int column)
Returns the value for an item (for this dataset, the mean value is returned).
-
getValue
public Number getValue(R rowKey, C columnKey)
Returns the value for an item (for this dataset, the mean value is returned).- Specified by:
getValuein interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the columnKey.- Returns:
- The value (possibly
null).
-
getMeanValue
public Number getMeanValue(R rowKey, C columnKey)
Returns the mean value for an item.- Specified by:
getMeanValuein interfaceStatisticalCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the columnKey.- Returns:
- The mean value (possibly
null).
-
getStdDevValue
public Number getStdDevValue(int row, int column)
Returns the standard deviation value for an item.- Specified by:
getStdDevValuein interfaceStatisticalCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The standard deviation (possibly
null).
-
getStdDevValue
public Number getStdDevValue(R rowKey, C columnKey)
Returns the standard deviation value for an item.- Specified by:
getStdDevValuein interfaceStatisticalCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the columnKey.- Returns:
- The standard deviation (possibly
null).
-
getColumnIndex
public int getColumnIndex(C key)
Returns the column index for a given key.- Specified by:
getColumnIndexin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
key- the column key (nullnot permitted).- Returns:
- The column index.
-
getColumnKey
public C getColumnKey(int column)
Returns a column key.- Specified by:
getColumnKeyin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
column- the column index (zero-based).- Returns:
- The column key.
-
getColumnKeys
public List<C> getColumnKeys()
Returns the column keys.- Specified by:
getColumnKeysin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Returns:
- The keys.
-
getRowIndex
public int getRowIndex(R key)
Returns the row index for a given key.- Specified by:
getRowIndexin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
key- the row key (nullnot permitted).- Returns:
- The row index.
-
getRowKey
public R getRowKey(int row)
Returns a row key.- Specified by:
getRowKeyin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).- Returns:
- The row key.
-
getRowKeys
public List<R> getRowKeys()
Returns the row keys.- Specified by:
getRowKeysin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- 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, R rowKey, C 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(Number mean, Number standardDeviation, R rowKey, C 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(R rowKey, C 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).- Since:
- 1.0.7
- 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.- Since:
- 1.0.7
- See Also:
removeColumn(int)
-
removeRow
public void removeRow(R rowKey)
Removes a row from the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
rowKey- the row key (nullnot permitted).- Since:
- 1.0.7
- 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.- Since:
- 1.0.7
- See Also:
removeRow(int)
-
removeColumn
public void removeColumn(C columnKey)
Removes a column from the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
columnKey- the column key (nullnot permitted).- Since:
- 1.0.7
- See Also:
removeRow(Comparable)
-
clear
public void clear()
Clears all data from the dataset and sends aDatasetChangeEventto all registered listeners.- Since:
- 1.0.7
-
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(Object obj)
Tests this instance for equality with an arbitrary object.
-
clone
public Object clone() throws CloneNotSupportedException
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.
-
-