org.jfree.data.statistics

Class DefaultMultiValueCategoryDataset

public class DefaultMultiValueCategoryDataset extends AbstractDataset implements MultiValueCategoryDataset, RangeInfo, PublicCloneable

A category dataset that defines multiple values for each item.

Since: 1.0.7

Field Summary
protected KeyedObjects2Ddata
Storage for the data.
Constructor Summary
DefaultMultiValueCategoryDataset()
Creates a new dataset.
Method Summary
voidadd(List values, Comparable rowKey, Comparable columnKey)
Adds a list of values to the dataset (null and Double.NaN items are automatically removed) and sends a DatasetChangeEvent to 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.
ComparablegetColumnKey(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.
ComparablegetRowKey(int row)
Returns a row key.
ListgetRowKeys()
Returns the row keys.
NumbergetValue(Comparable row, Comparable column)
Returns the average value for the specified item.
NumbergetValue(int row, int column)
Returns the average value for the specified item.
ListgetValues(int row, int column)
Returns a list (possibly empty) of the values for the specified item.
ListgetValues(Comparable rowKey, Comparable columnKey)
Returns a list (possibly empty) of the values for the specified item.

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 values, Comparable rowKey, Comparable columnKey)
Adds a list of values to the dataset (null and Double.NaN items are automatically removed) and sends a DatasetChangeEvent to all registered listeners.

Parameters: values a list of values (null not permitted). rowKey the row key (null not permitted). columnKey the column key (null not permitted).

clone

public Object clone()
Returns a clone of this instance.

Returns: A clone.

Throws: CloneNotSupportedException if the dataset cannot be cloned.

equals

public boolean equals(Object obj)
Tests this dataset for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getColumnCount

public int getColumnCount()
Returns the number of columns in the table.

Returns: The column count.

getColumnIndex

public int getColumnIndex(Comparable key)
Returns the column index for a given key.

Parameters: key the column key.

Returns: The column index.

getColumnKey

public Comparable getColumnKey(int column)
Returns a column key.

Parameters: column the column index (zero-based).

Returns: The column key.

getColumnKeys

public List getColumnKeys()
Returns the column keys.

Returns: The keys.

getRangeBounds

public Range getRangeBounds(boolean includeInterval)
Returns the range of the values in this dataset's range.

Parameters: includeInterval a flag that determines whether or not the y-interval is taken into account.

Returns: The range.

getRangeLowerBound

public double getRangeLowerBound(boolean includeInterval)
Returns the minimum y-value in the dataset.

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.

Parameters: includeInterval a flag that determines whether or not the y-interval is taken into account.

Returns: The maximum value.

getRowCount

public int getRowCount()
Returns the number of rows in the table.

Returns: The row count.

getRowIndex

public int getRowIndex(Comparable key)
Returns the row index for a given key.

Parameters: key the row key.

Returns: The row index.

getRowKey

public Comparable getRowKey(int row)
Returns a row key.

Parameters: row the row index (zero-based).

Returns: The row key.

getRowKeys

public List getRowKeys()
Returns the row keys.

Returns: The keys.

getValue

public Number getValue(Comparable row, Comparable column)
Returns the average value for the specified item.

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.

Parameters: row the row index. column the column index.

Returns: The average value.

getValues

public List getValues(int row, int column)
Returns a list (possibly empty) of the values for the specified item. The returned list should be unmodifiable.

Parameters: row the row index (zero-based). column the column index (zero-based).

Returns: The list of values.

getValues

public List getValues(Comparable rowKey, Comparable columnKey)
Returns a list (possibly empty) of the values for the specified item. The returned list should be unmodifiable.

Parameters: rowKey the row key (null not permitted). columnKey the column key (null not permitted).

Returns: The list of values.