Module org.jfree.chart
Package org.jfree.data.statistics
Class DefaultMultiValueCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>
- java.lang.Object
-
- org.jfree.data.general.AbstractDataset
-
- org.jfree.data.statistics.DefaultMultiValueCategoryDataset<R,C>
-
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,PublicCloneable,CategoryDataset<R,C>,Dataset,KeyedValues2D<R,C>,RangeInfo,MultiValueCategoryDataset<R,C>,Values2D
public class DefaultMultiValueCategoryDataset<R extends Comparable<R>,C extends Comparable<C>> extends AbstractDataset implements MultiValueCategoryDataset<R,C>, RangeInfo, PublicCloneable
A category dataset that defines multiple values for each item.- Since:
- 1.0.7
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected KeyedObjects2DdataStorage for the data.
-
Constructor Summary
Constructors Constructor Description DefaultMultiValueCategoryDataset()Creates a new dataset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(List<? extends Number> values, R rowKey, C columnKey)Adds a list of values to the dataset (nulland Double.NaN items are automatically removed) and sends aDatasetChangeEventto all registered listeners.Objectclone()Returns a clone of this instance.booleanequals(Object obj)Tests this dataset for equality with an arbitrary object.intgetColumnCount()Returns the number of columns in the table.intgetColumnIndex(Comparable key)Returns the column index for a given key.CgetColumnKey(int column)Returns a column key.ListgetColumnKeys()Returns the column keys.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(Comparable key)Returns the row index for a given key.RgetRowKey(int row)Returns a row key.ListgetRowKeys()Returns the row keys.NumbergetValue(int row, int column)Returns the average value for the specified item.NumbergetValue(Comparable row, Comparable column)Returns the average value for the specified item.List<? extends Number>getValues(int row, int column)Returns a list (possibly empty) of the values for the specified item.List<? extends Number>getValues(Comparable rowKey, Comparable columnKey)Returns a list (possibly empty) of the values for the specified item.inthashCode()-
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 data
Storage for the data.
-
-
Constructor Detail
-
DefaultMultiValueCategoryDataset
public DefaultMultiValueCategoryDataset()
Creates a new dataset.
-
-
Method Detail
-
add
public void add(List<? extends Number> values, R rowKey, C columnKey)
Adds a list of values to the dataset (nulland Double.NaN items are automatically removed) and sends aDatasetChangeEventto all registered listeners.- Parameters:
values- a list of values (nullnot permitted).rowKey- the row key (nullnot permitted).columnKey- the column key (nullnot permitted).
-
getValues
public List<? extends Number> getValues(int row, int column)
Returns a list (possibly empty) of the values for the specified item. The returned list should be unmodifiable.- Specified by:
getValuesin interfaceMultiValueCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The list of values.
-
getValues
public List<? extends Number> getValues(Comparable rowKey, Comparable columnKey)
Returns a list (possibly empty) of the values for the specified item. The returned list should be unmodifiable.- Specified by:
getValuesin interfaceMultiValueCategoryDataset<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
rowKey- the row key (nullnot permitted).columnKey- the column key (nullnot permitted).- Returns:
- The list of values.
-
getValue
public Number getValue(Comparable row, Comparable column)
Returns the average value for the specified item.- Specified by:
getValuein interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Parameters:
row- the row key.column- the column key.- Returns:
- The average value.
-
getValue
public Number getValue(int row, int column)
Returns the average value for the specified item.
-
getColumnIndex
public int getColumnIndex(Comparable 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.- 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 getColumnKeys()
Returns the column keys.- Specified by:
getColumnKeysin interfaceKeyedValues2D<R extends Comparable<R>,C extends Comparable<C>>- Returns:
- The keys.
-
getRowIndex
public int getRowIndex(Comparable 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.- 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 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.
-
getColumnCount
public int getColumnCount()
Returns the number of columns in the table.- Specified by:
getColumnCountin interfaceValues2D- Returns:
- The column count.
-
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.
-
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.
-
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.
-
clone
public Object clone() throws CloneNotSupportedException
Returns a clone of this instance.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if the dataset cannot be cloned.
-
-