All Implemented Interfaces:
ObjectInputValidation
,
Serializable
,
Cloneable
,
PublicCloneable
,
CategoryDataset
,
Dataset
,
KeyedValues2D
,
Values2D
Direct Known Subclasses:
DefaultKeyedValues2DDataset
,
JDBCCategoryDataset
public class DefaultCategoryDataset
extends AbstractDataset
implements CategoryDataset, PublicCloneable, Serializable
See Also:
Serialized Form
Comparable
rowKey,
Comparable
columnKey)
Adds the specified value to an existing value in the dataset (if the
existing value is
null
, it is treated as if it were 0.0).
removeColumn
(
Comparable
columnKey)
Removes a column from the dataset and sends a
DatasetChangeEvent
to all registered listeners.
removeColumn
(int columnIndex)
Removes a column from the dataset and sends a
DatasetChangeEvent
to all registered listeners.
removeRow
(
Comparable
rowKey)
Removes a row from the dataset and sends a
DatasetChangeEvent
to all registered listeners.
removeRow
(int rowIndex)
Removes a row from the dataset and sends a
DatasetChangeEvent
to all registered listeners.
removeValue
(
Comparable
rowKey,
Comparable
columnKey)
Removes a value from the dataset and sends a
DatasetChangeEvent
to all registered listeners.
setValue
(double value,
Comparable
rowKey,
Comparable
columnKey)
Adds or updates a value in the table and sends a
DatasetChangeEvent
to all registered listeners.
setValue
(
Number
value,
Comparable
rowKey,
Comparable
columnKey)
Adds or updates a value in the table and sends a
DatasetChangeEvent
to all registered listeners.
getRowIndex
public int getRowIndex(Comparable key)
Returns the row index for a given key.
Specified by:
getRowIndex
in interface
KeyedValues2D
Parameters:
key
- the row key (
null
not permitted).
Returns:
The row index.
See Also:
getRowKey(int)
getColumnKey
in interface
KeyedValues2D
Parameters:
column
- the column index (zero-based).
Returns:
The column key.
See Also:
getColumnIndex(Comparable)
getColumnIndex
public int getColumnIndex(Comparable key)
Returns the column index for a given key.
Specified by:
getColumnIndex
in interface
KeyedValues2D
Parameters:
key
- the column key (
null
not permitted).
Returns:
The column index.
See Also:
getColumnKey(int)
public Number getValue(Comparable rowKey,
Comparable columnKey)
Returns the value for a pair of keys.
Specified by:
getValue
in interface
KeyedValues2D
Parameters:
rowKey
- the row key (
null
not permitted).
columnKey
- the column key (
null
not permitted).
Returns:
The value (possibly
null
).
Throws:
UnknownKeyException
- if either key is not defined in the dataset.
See Also:
addValue(Number, Comparable, Comparable)
Comparable
rowKey,
Comparable
columnKey)
Adds a value to the table. Performs the same function as setValue().
Parameters:
value
- the value.
rowKey
- the row key.
columnKey
- the column key.
See Also:
getValue(Comparable, Comparable)
,
removeValue(Comparable, Comparable)
Comparable
rowKey,
Comparable
columnKey)
Adds or updates a value in the table and sends a
DatasetChangeEvent
to all registered listeners.
Parameters:
value
- the value (
null
permitted).
rowKey
- the row key (
null
not permitted).
columnKey
- the column key (
null
not permitted).
See Also:
getValue(Comparable, Comparable)
Comparable
rowKey,
Comparable
columnKey)
Adds or updates a value in the table and sends a
DatasetChangeEvent
to all registered listeners.
Parameters:
value
- the value.
rowKey
- the row key (
null
not permitted).
columnKey
- the column key (
null
not permitted).
See Also:
getValue(Comparable, Comparable)
Comparable
rowKey,
Comparable
columnKey)
Adds the specified value to an existing value in the dataset (if the
existing value is
null
, it is treated as if it were 0.0).
Parameters:
value
- the value.
rowKey
- the row key (
null
not permitted).
columnKey
- the column key (
null
not permitted).
Throws:
UnknownKeyException
- if either key is not defined in the dataset.
public void removeValue(Comparable rowKey,
Comparable columnKey)
Removes a value from the dataset and sends a
DatasetChangeEvent
to all registered listeners.
Parameters:
rowKey
- the row key.
columnKey
- the column key.
See Also:
addValue(Number, Comparable, Comparable)
removeRow
public void removeRow(int rowIndex)
Removes a row from the dataset and sends a
DatasetChangeEvent
to all registered listeners.
Parameters:
rowIndex
- the row index.
See Also:
removeColumn(int)
removeRow
public void removeRow(Comparable rowKey)
Removes a row from the dataset and sends a
DatasetChangeEvent
to 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 a
DatasetChangeEvent
to all registered listeners.
Parameters:
columnIndex
- the column index.
See Also:
removeRow(int)
removeColumn
public void removeColumn(Comparable columnKey)
Removes a column from the dataset and sends a
DatasetChangeEvent
to all registered listeners.
Parameters:
columnKey
- the column key (
null
not permitted).
Throws:
UnknownKeyException
- if
columnKey
is not defined
in the dataset.
See Also:
removeRow(Comparable)
equals
public boolean equals(Object obj)
Tests this dataset for equality with an arbitrary object.
Overrides:
equals
in class
Object
Parameters:
obj
- the object (
null
permitted).
Returns:
A boolean.