Package org.jfree.data.statistics
Class DefaultBoxAndWhiskerCategoryDataset
- java.lang.Object
-
- org.jfree.data.general.AbstractDataset
-
- org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset
-
- All Implemented Interfaces:
java.io.ObjectInputValidation,java.io.Serializable,java.lang.Cloneable,PublicCloneable,CategoryDataset,Dataset,KeyedValues2D,RangeInfo,BoxAndWhiskerCategoryDataset,Values2D
public class DefaultBoxAndWhiskerCategoryDataset extends AbstractDataset implements BoxAndWhiskerCategoryDataset, RangeInfo, PublicCloneable
A convenience class that provides a default implementation of theBoxAndWhiskerCategoryDatasetinterface.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected KeyedObjects2DdataStorage for the data.private doublemaximumRangeValueThe maximum range value.private intmaximumRangeValueColumnThe column index for the cell that the maximum range value comes from.private intmaximumRangeValueRowThe row index for the cell that the maximum range value comes from.private doubleminimumRangeValueThe minimum range value.private intminimumRangeValueColumnThe column index for the cell that the minimum range value comes from.private intminimumRangeValueRowThe row index for the cell that the minimum range value comes from.
-
Constructor Summary
Constructors Constructor Description DefaultBoxAndWhiskerCategoryDataset()Creates a new dataset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.util.List list, java.lang.Comparable rowKey, java.lang.Comparable columnKey)Adds a list of values relating to one box-and-whisker entity to the table.voidadd(BoxAndWhiskerItem item, java.lang.Comparable rowKey, java.lang.Comparable columnKey)Adds a list of values relating to one Box and Whisker entity 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 dataset 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.BoxAndWhiskerItemgetItem(int row, int column)Return an item from within the dataset.java.lang.NumbergetMaxOutlier(int row, int column)Returns the maximum outlier (non farout) value for an item.java.lang.NumbergetMaxOutlier(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the maximum outlier (non farout) value for an item.java.lang.NumbergetMaxRegularValue(int row, int column)Returns the maximum regular (non outlier) value for an item.java.lang.NumbergetMaxRegularValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the maximum regular (non outlier) value for an item.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.java.lang.NumbergetMedianValue(int row, int column)Returns the median value for an item.java.lang.NumbergetMedianValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the median value for an item.java.lang.NumbergetMinOutlier(int row, int column)Returns the minimum outlier (non farout) value for an item.java.lang.NumbergetMinOutlier(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the minimum outlier (non farout) value for an item.java.lang.NumbergetMinRegularValue(int row, int column)Returns the minimum regular (non outlier) value for an item.java.lang.NumbergetMinRegularValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the minimum regular (non outlier) value for an item.java.util.ListgetOutliers(int row, int column)Returns a list of outlier values for an item.java.util.ListgetOutliers(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns a list of outlier values for an item.java.lang.NumbergetQ1Value(int row, int column)Returns the first quartile value.java.lang.NumbergetQ1Value(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the first quartile value.java.lang.NumbergetQ3Value(int row, int column)Returns the third quartile value.java.lang.NumbergetQ3Value(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the third quartile value.RangegetRangeBounds(boolean includeInterval)Returns the range of the values in this dataset's range.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.NumbergetValue(int row, int column)Returns the value for an item.java.lang.NumbergetValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the value for an item.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()Resets the cached bounds, by iterating over the entire dataset to find the current bounds.-
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
protected KeyedObjects2D data
Storage for the data.
-
minimumRangeValue
private double minimumRangeValue
The minimum range value.
-
minimumRangeValueRow
private int minimumRangeValueRow
The row index for the cell that the minimum range value comes from.
-
minimumRangeValueColumn
private int minimumRangeValueColumn
The column index for the cell that the minimum range value comes from.
-
maximumRangeValue
private double maximumRangeValue
The maximum range value.
-
maximumRangeValueRow
private int maximumRangeValueRow
The row index for the cell that the maximum range value comes from.
-
maximumRangeValueColumn
private int maximumRangeValueColumn
The column index for the cell that the maximum range value comes from.
-
-
Method Detail
-
add
public void add(java.util.List list, java.lang.Comparable rowKey, java.lang.Comparable columnKey)Adds a list of values relating to one box-and-whisker entity to the table. The various median values are calculated.- Parameters:
list- a collection of values from which the various medians will be calculated.rowKey- the row key (nullnot permitted).columnKey- the column key (nullnot permitted).- See Also:
add(BoxAndWhiskerItem, Comparable, Comparable)
-
add
public void add(BoxAndWhiskerItem item, java.lang.Comparable rowKey, java.lang.Comparable columnKey)
Adds a list of values relating to one Box and Whisker entity to the table. The various median values are calculated.- Parameters:
item- a box and whisker item (nullnot permitted).rowKey- the row key (nullnot permitted).columnKey- the column key (nullnot permitted).- See Also:
add(List, Comparable, Comparable)
-
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(BoxAndWhiskerItem, 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.- 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.- See Also:
removeRow(Comparable)
-
clear
public void clear()
Clears all data from the dataset and sends aDatasetChangeEventto all registered listeners.
-
getItem
public BoxAndWhiskerItem getItem(int row, int column)
Return an item from within the dataset.- Parameters:
row- the row index.column- the column index.- Returns:
- The item.
-
getValue
public java.lang.Number getValue(int row, int column)Returns the value for an item.- Specified by:
getValuein interfaceValues2D- Parameters:
row- the row index.column- the column index.- Returns:
- The value.
- See Also:
getMedianValue(int, int),getValue(Comparable, Comparable)
-
getValue
public java.lang.Number getValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the value for an item.- Specified by:
getValuein interfaceKeyedValues2D- Parameters:
rowKey- the row key.columnKey- the columnKey.- Returns:
- The value.
- See Also:
getMedianValue(Comparable, Comparable),getValue(int, int)
-
getMeanValue
public java.lang.Number getMeanValue(int row, int column)Returns the mean value for an item.- Specified by:
getMeanValuein interfaceBoxAndWhiskerCategoryDataset- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The mean value.
- See Also:
getItem(int, int)
-
getMeanValue
public java.lang.Number getMeanValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the mean value for an item.- Specified by:
getMeanValuein interfaceBoxAndWhiskerCategoryDataset- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The mean value.
- See Also:
getItem(int, int)
-
getMedianValue
public java.lang.Number getMedianValue(int row, int column)Returns the median value for an item.- Specified by:
getMedianValuein interfaceBoxAndWhiskerCategoryDataset- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The median value.
- See Also:
getItem(int, int)
-
getMedianValue
public java.lang.Number getMedianValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the median value for an item.- Specified by:
getMedianValuein interfaceBoxAndWhiskerCategoryDataset- Parameters:
rowKey- the row key.columnKey- the columnKey.- Returns:
- The median value.
- See Also:
getItem(int, int)
-
getQ1Value
public java.lang.Number getQ1Value(int row, int column)Returns the first quartile value.- Specified by:
getQ1Valuein interfaceBoxAndWhiskerCategoryDataset- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The first quartile value.
- See Also:
getItem(int, int)
-
getQ1Value
public java.lang.Number getQ1Value(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the first quartile value.- Specified by:
getQ1Valuein interfaceBoxAndWhiskerCategoryDataset- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The first quartile value.
- See Also:
getItem(int, int)
-
getQ3Value
public java.lang.Number getQ3Value(int row, int column)Returns the third quartile value.- Specified by:
getQ3Valuein interfaceBoxAndWhiskerCategoryDataset- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The third quartile value.
- See Also:
getItem(int, int)
-
getQ3Value
public java.lang.Number getQ3Value(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the third quartile value.- Specified by:
getQ3Valuein interfaceBoxAndWhiskerCategoryDataset- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The third quartile value.
- See Also:
getItem(int, int)
-
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.
- See Also:
getColumnKey(int)
-
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.
- See Also:
getColumnIndex(Comparable)
-
getColumnKeys
public java.util.List getColumnKeys()
Returns the column keys.- Specified by:
getColumnKeysin interfaceKeyedValues2D- Returns:
- The keys.
- See Also:
getRowKeys()
-
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.
- See Also:
getRowKey(int)
-
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.
- See Also:
getRowIndex(Comparable)
-
getRowKeys
public java.util.List getRowKeys()
Returns the row keys.- Specified by:
getRowKeysin interfaceKeyedValues2D- Returns:
- The keys.
- See Also:
getColumnKeys()
-
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()
-
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 range of the values in this dataset's range.- Specified by:
getRangeBoundsin interfaceRangeInfo- Parameters:
includeInterval- a flag that determines whether or not the y-interval is taken into account.- Returns:
- The range.
-
getMinRegularValue
public java.lang.Number getMinRegularValue(int row, int column)Returns the minimum regular (non outlier) value for an item.- Specified by:
getMinRegularValuein interfaceBoxAndWhiskerCategoryDataset- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The minimum regular value.
- See Also:
getItem(int, int)
-
getMinRegularValue
public java.lang.Number getMinRegularValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the minimum regular (non outlier) value for an item.- Specified by:
getMinRegularValuein interfaceBoxAndWhiskerCategoryDataset- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The minimum regular value.
- See Also:
getItem(int, int)
-
getMaxRegularValue
public java.lang.Number getMaxRegularValue(int row, int column)Returns the maximum regular (non outlier) value for an item.- Specified by:
getMaxRegularValuein interfaceBoxAndWhiskerCategoryDataset- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The maximum regular value.
- See Also:
getItem(int, int)
-
getMaxRegularValue
public java.lang.Number getMaxRegularValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the maximum regular (non outlier) value for an item.- Specified by:
getMaxRegularValuein interfaceBoxAndWhiskerCategoryDataset- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The maximum regular value.
- See Also:
getItem(int, int)
-
getMinOutlier
public java.lang.Number getMinOutlier(int row, int column)Returns the minimum outlier (non farout) value for an item.- Specified by:
getMinOutlierin interfaceBoxAndWhiskerCategoryDataset- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The minimum outlier.
- See Also:
getItem(int, int)
-
getMinOutlier
public java.lang.Number getMinOutlier(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the minimum outlier (non farout) value for an item.- Specified by:
getMinOutlierin interfaceBoxAndWhiskerCategoryDataset- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The minimum outlier.
- See Also:
getItem(int, int)
-
getMaxOutlier
public java.lang.Number getMaxOutlier(int row, int column)Returns the maximum outlier (non farout) value for an item.- Specified by:
getMaxOutlierin interfaceBoxAndWhiskerCategoryDataset- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The maximum outlier.
- See Also:
getItem(int, int)
-
getMaxOutlier
public java.lang.Number getMaxOutlier(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the maximum outlier (non farout) value for an item.- Specified by:
getMaxOutlierin interfaceBoxAndWhiskerCategoryDataset- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The maximum outlier.
- See Also:
getItem(int, int)
-
getOutliers
public java.util.List getOutliers(int row, int column)Returns a list of outlier values for an item.- Specified by:
getOutliersin interfaceBoxAndWhiskerCategoryDataset- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- A list of outlier values.
- See Also:
getItem(int, int)
-
getOutliers
public java.util.List getOutliers(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns a list of outlier values for an item.- Specified by:
getOutliersin interfaceBoxAndWhiskerCategoryDataset- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- A list of outlier values.
- See Also:
getItem(int, int)
-
updateBounds
private void updateBounds()
Resets the cached bounds, by iterating over the entire dataset to find the current bounds.
-
equals
public boolean equals(java.lang.Object obj)
Tests this dataset for equality with an arbitrary object.- Overrides:
equalsin classAbstractDataset- Parameters:
obj- the object to test against (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.
- Throws:
java.lang.CloneNotSupportedException- if cloning is not possible.
-
-