Module org.jfree.chart
Package org.jfree.data.statistics
Class DefaultBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>
- java.lang.Object
-
- org.jfree.data.general.AbstractDataset
-
- org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset<R,C>
-
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,PublicCloneable,CategoryDataset<R,C>,Dataset,KeyedValues2D<R,C>,RangeInfo,BoxAndWhiskerCategoryDataset<R,C>,Values2D
public class DefaultBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>> extends AbstractDataset implements BoxAndWhiskerCategoryDataset<R,C>, 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 KeyedObjects2D<R,C>dataStorage for the data.
-
Constructor Summary
Constructors Constructor Description DefaultBoxAndWhiskerCategoryDataset()Creates a new dataset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(List<? extends Number> list, R rowKey, C columnKey)Adds a list of values relating to one box-and-whisker entity to the table.voidadd(BoxAndWhiskerItem item, R rowKey, C 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.Objectclone()Returns a clone of this dataset.booleanequals(Object obj)Tests this dataset 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.BoxAndWhiskerItemgetItem(int row, int column)Return an item from within the dataset.NumbergetMaxOutlier(int row, int column)Returns the maximum outlier (non farout) value for an item.NumbergetMaxOutlier(R rowKey, C columnKey)Returns the maximum outlier (non farout) value for an item.NumbergetMaxRegularValue(int row, int column)Returns the maximum regular (non outlier) value for an item.NumbergetMaxRegularValue(R rowKey, C columnKey)Returns the maximum regular (non outlier) value for an item.NumbergetMeanValue(int row, int column)Returns the mean value for an item.NumbergetMeanValue(R rowKey, C columnKey)Returns the mean value for an item.NumbergetMedianValue(int row, int column)Returns the median value for an item.NumbergetMedianValue(R rowKey, C columnKey)Returns the median value for an item.NumbergetMinOutlier(int row, int column)Returns the minimum outlier (non farout) value for an item.NumbergetMinOutlier(R rowKey, C columnKey)Returns the minimum outlier (non farout) value for an item.NumbergetMinRegularValue(int row, int column)Returns the minimum regular (non outlier) value for an item.NumbergetMinRegularValue(R rowKey, C columnKey)Returns the minimum regular (non outlier) value for an item.List<? extends Number>getOutliers(int row, int column)Returns a list of outlier values for an item.List<? extends Number>getOutliers(R rowKey, C columnKey)Returns a list of outlier values for an item.NumbergetQ1Value(int row, int column)Returns the first quartile value.NumbergetQ1Value(R rowKey, C columnKey)Returns the first quartile value.NumbergetQ3Value(int row, int column)Returns the third quartile value.NumbergetQ3Value(R rowKey, C 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(R key)Returns the row index for a given key.RgetRowKey(int row)Returns a row key.List<R>getRowKeys()Returns the row keys.NumbergetValue(int row, int column)Returns the value for an item.NumbergetValue(R rowKey, C columnKey)Returns the value for an item.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
-
-
-
-
Field Detail
-
data
protected KeyedObjects2D<R extends Comparable<R>,C extends Comparable<C>> data
Storage for the data.
-
-
Constructor Detail
-
DefaultBoxAndWhiskerCategoryDataset
public DefaultBoxAndWhiskerCategoryDataset()
Creates a new dataset.
-
-
Method Detail
-
add
public void add(List<? extends Number> list, R rowKey, C 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, R rowKey, C 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(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(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.- 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.- 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.- 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
-
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 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 Number getValue(R rowKey, C columnKey)
Returns the value for an item.- Specified by:
getValuein interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the columnKey.- Returns:
- The value.
- See Also:
getMedianValue(Comparable, Comparable),getValue(int, int)
-
getMeanValue
public Number getMeanValue(int row, int column)
Returns the mean value for an item.- Specified by:
getMeanValuein interfaceBoxAndWhiskerCategoryDataset<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.
- See Also:
getItem(int, int)
-
getMeanValue
public Number getMeanValue(R rowKey, C columnKey)
Returns the mean value for an item.- Specified by:
getMeanValuein interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The mean value.
- See Also:
getItem(int, int)
-
getMedianValue
public Number getMedianValue(int row, int column)
Returns the median value for an item.- Specified by:
getMedianValuein interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The median value.
- See Also:
getItem(int, int)
-
getMedianValue
public Number getMedianValue(R rowKey, C columnKey)
Returns the median value for an item.- Specified by:
getMedianValuein interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the columnKey.- Returns:
- The median value.
- See Also:
getItem(int, int)
-
getQ1Value
public Number getQ1Value(int row, int column)
Returns the first quartile value.- Specified by:
getQ1Valuein interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- 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 Number getQ1Value(R rowKey, C columnKey)
Returns the first quartile value.- Specified by:
getQ1Valuein interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The first quartile value.
- See Also:
getItem(int, int)
-
getQ3Value
public Number getQ3Value(int row, int column)
Returns the third quartile value.- Specified by:
getQ3Valuein interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- 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 Number getQ3Value(R rowKey, C columnKey)
Returns the third quartile value.- Specified by:
getQ3Valuein interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The third quartile value.
- See Also:
getItem(int, int)
-
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.
- See Also:
getColumnKey(int)
-
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.
- See Also:
getColumnIndex(Comparable)
-
getColumnKeys
public List<C> getColumnKeys()
Returns the column keys.- Specified by:
getColumnKeysin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Returns:
- The keys.
- See Also:
getRowKeys()
-
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.
- See Also:
getRowKey(int)
-
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.
- See Also:
getRowIndex(Comparable)
-
getRowKeys
public List<R> getRowKeys()
Returns the row keys.- Specified by:
getRowKeysin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- 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 Number getMinRegularValue(int row, int column)
Returns the minimum regular (non outlier) value for an item.- Specified by:
getMinRegularValuein interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- 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 Number getMinRegularValue(R rowKey, C columnKey)
Returns the minimum regular (non outlier) value for an item.- Specified by:
getMinRegularValuein interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The minimum regular value.
- See Also:
getItem(int, int)
-
getMaxRegularValue
public Number getMaxRegularValue(int row, int column)
Returns the maximum regular (non outlier) value for an item.- Specified by:
getMaxRegularValuein interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- 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 Number getMaxRegularValue(R rowKey, C columnKey)
Returns the maximum regular (non outlier) value for an item.- Specified by:
getMaxRegularValuein interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The maximum regular value.
- See Also:
getItem(int, int)
-
getMinOutlier
public Number getMinOutlier(int row, int column)
Returns the minimum outlier (non farout) value for an item.- Specified by:
getMinOutlierin interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The minimum outlier.
- See Also:
getItem(int, int)
-
getMinOutlier
public Number getMinOutlier(R rowKey, C columnKey)
Returns the minimum outlier (non farout) value for an item.- Specified by:
getMinOutlierin interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The minimum outlier.
- See Also:
getItem(int, int)
-
getMaxOutlier
public Number getMaxOutlier(int row, int column)
Returns the maximum outlier (non farout) value for an item.- Specified by:
getMaxOutlierin interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The maximum outlier.
- See Also:
getItem(int, int)
-
getMaxOutlier
public Number getMaxOutlier(R rowKey, C columnKey)
Returns the maximum outlier (non farout) value for an item.- Specified by:
getMaxOutlierin interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- The maximum outlier.
- See Also:
getItem(int, int)
-
getOutliers
public List<? extends Number> getOutliers(int row, int column)
Returns a list of outlier values for an item.- Specified by:
getOutliersin interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- 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 List<? extends Number> getOutliers(R rowKey, C columnKey)
Returns a list of outlier values for an item.- Specified by:
getOutliersin interfaceBoxAndWhiskerCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key.columnKey- the column key.- Returns:
- A list of outlier values.
- See Also:
getItem(int, int)
-
clone
public Object clone() throws CloneNotSupportedException
Returns a clone of this dataset.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if cloning is not possible.
-
-