Package org.jfree.data.statistics
Class DefaultMultiValueCategoryDataset
- java.lang.Object
-
- org.jfree.data.general.AbstractDataset
-
- org.jfree.data.statistics.DefaultMultiValueCategoryDataset
-
- All Implemented Interfaces:
java.io.ObjectInputValidation,java.io.Serializable,java.lang.Cloneable,PublicCloneable,CategoryDataset,Dataset,KeyedValues2D,RangeInfo,MultiValueCategoryDataset,Values2D
public class DefaultMultiValueCategoryDataset extends AbstractDataset implements MultiValueCategoryDataset, RangeInfo, PublicCloneable
A category dataset that defines multiple values for each item.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected KeyedObjects2DdataStorage for the data.private java.lang.NumbermaximumRangeValueThe maximum range value.private java.lang.NumberminimumRangeValueThe minimum range value.private RangerangeBoundsThe range of values.
-
Constructor Summary
Constructors Constructor Description DefaultMultiValueCategoryDataset()Creates a new dataset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.util.List values, java.lang.Comparable rowKey, java.lang.Comparable columnKey)Adds a list of values to the dataset (nulland Double.NaN items are automatically removed) and sends aDatasetChangeEventto all registered listeners.java.lang.Objectclone()Returns a clone of this instance.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.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 average value for the specified item.java.lang.NumbergetValue(java.lang.Comparable row, java.lang.Comparable column)Returns the average value for the specified item.java.util.ListgetValues(int row, int column)Returns a list (possibly empty) of the values for the specified item.java.util.ListgetValues(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns a list (possibly empty) of the values for the specified item.-
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 java.lang.Number minimumRangeValue
The minimum range value.
-
maximumRangeValue
private java.lang.Number maximumRangeValue
The maximum range value.
-
rangeBounds
private Range rangeBounds
The range of values.
-
-
Method Detail
-
add
public void add(java.util.List values, java.lang.Comparable rowKey, java.lang.Comparable 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 java.util.List 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- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The list of values.
-
getValues
public java.util.List getValues(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns a list (possibly empty) of the values for the specified item. The returned list should be unmodifiable.- Specified by:
getValuesin interfaceMultiValueCategoryDataset- Parameters:
rowKey- the row key (nullnot permitted).columnKey- the column key (nullnot permitted).- Returns:
- The list of values.
-
getValue
public java.lang.Number getValue(java.lang.Comparable row, java.lang.Comparable column)Returns the average value for the specified item.- Specified by:
getValuein interfaceKeyedValues2D- Parameters:
row- the row key.column- the column key.- Returns:
- The average value.
-
getValue
public java.lang.Number getValue(int row, int column)Returns the average value for the specified item.
-
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.- Returns:
- The column index.
-
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.
-
getColumnKeys
public java.util.List getColumnKeys()
Returns the column keys.- Specified by:
getColumnKeysin interfaceKeyedValues2D- Returns:
- The keys.
-
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.- Returns:
- The row index.
-
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.
-
getRowKeys
public java.util.List 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.
-
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.
-
equals
public boolean equals(java.lang.Object obj)
Tests this dataset for equality with an arbitrary object.- Overrides:
equalsin classAbstractDataset- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of this instance.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if the dataset cannot be cloned.
-
-