Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.data.DefaultKeyedValues2D
public class DefaultKeyedValues2D
extends java.lang.Object
implements KeyedValues2D, PublicCloneable, Cloneable, Serializable
Comparable
and (b) immutable.
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
Object |
|
boolean |
|
int |
|
int |
|
Comparable |
|
List |
|
int |
|
int |
|
Comparable |
|
List |
|
Number |
|
Number |
|
int |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public DefaultKeyedValues2D(boolean sortRowKeys)
Creates a new instance (initially empty).
- Parameters:
sortRowKeys
- if the row keys should be sorted.
public void addValue(Number value, Comparable rowKey, Comparable columnKey)
Adds a value to the table. Performs the same function as #setValue(Number, Comparable, Comparable).
- Parameters:
value
- the value (null
permitted).rowKey
- the row key (null
not permitted).columnKey
- the column key (null
not permitted).
public boolean equals(Object o)
Tests if this object is equal to another.
- Parameters:
o
- the other object (null
permitted).
- Returns:
- A boolean.
public int getColumnCount()
Returns the column count.
- Specified by:
- getColumnCount in interface Values2D
- Returns:
- The column count.
- See Also:
getRowCount()
public int getColumnIndex(Comparable key)
Returns the column index for a given key.
- Specified by:
- getColumnIndex in interface KeyedValues2D
- Parameters:
key
- the key (null
not permitted).
- Returns:
- The column index.
- See Also:
getColumnKey(int)
,getRowIndex(Comparable)
public Comparable getColumnKey(int column)
Returns the key for a given column.
- Specified by:
- getColumnKey in interface KeyedValues2D
- Parameters:
column
- the column (in the range 0 togetColumnCount()
- 1).
- Returns:
- The key.
- See Also:
getColumnIndex(Comparable)
,getRowKey(int)
public List getColumnKeys()
Returns the column keys in an unmodifiable list.
- Specified by:
- getColumnKeys in interface KeyedValues2D
- Returns:
- The column keys.
- See Also:
getRowKeys()
public int getRowCount()
Returns the row count.
- Specified by:
- getRowCount in interface Values2D
- Returns:
- The row count.
- See Also:
getColumnCount()
public int getRowIndex(Comparable key)
Returns the row index for a given key.
- Specified by:
- getRowIndex in interface KeyedValues2D
- Parameters:
key
- the key (null
not permitted).
- Returns:
- The row index.
- See Also:
getRowKey(int)
,getColumnIndex(Comparable)
public Comparable getRowKey(int row)
Returns the key for a given row.
- Specified by:
- getRowKey in interface KeyedValues2D
- Parameters:
row
- the row index (in the range 0 togetRowCount()
- 1).
- Returns:
- The row key.
- See Also:
getRowIndex(Comparable)
,getColumnKey(int)
public List getRowKeys()
Returns the row keys in an unmodifiable list.
- Specified by:
- getRowKeys in interface KeyedValues2D
- Returns:
- The row keys.
- See Also:
getColumnKeys()
public Number getValue(Comparable rowKey, Comparable columnKey)
Returns the value for the given row and column keys. This method will throw anUnknownKeyException
if either key is not defined in the data structure.
- 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
).
public Number getValue(int row, int column)
Returns the value for a given row and column.
- Parameters:
row
- the row index.column
- the column index.
- Returns:
- The value.
- See Also:
getValue(Comparable,Comparable)
public void removeColumn(Comparable columnKey)
Removes a column from the table.
- Parameters:
columnKey
- the column key (null
not permitted).
- See Also:
removeColumn(int)
,removeRow(Comparable)
public void removeColumn(int columnIndex)
Removes a column.
- Parameters:
columnIndex
- the column index.
- See Also:
removeColumn(Comparable)
,removeRow(int)
public void removeRow(Comparable rowKey)
Removes a row from the table.
- Parameters:
rowKey
- the row key (null
not permitted).
- See Also:
removeRow(int)
,removeColumn(Comparable)
public void removeRow(int rowIndex)
Removes a row.
- Parameters:
rowIndex
- the row index.
- See Also:
removeRow(Comparable)
,removeColumn(int)
public void removeValue(Comparable rowKey, Comparable columnKey)
Removes a value from the table by setting it tonull
. If all the values in the specified row and/or column are nownull
, the row and/or column is removed from the table.
- Parameters:
rowKey
- the row key (null
not permitted).columnKey
- the column key (null
not permitted).
public void setValue(Number value, Comparable rowKey, Comparable columnKey)
Adds or updates a value.
- Parameters:
value
- the value (null
permitted).rowKey
- the row key (null
not permitted).columnKey
- the column key (null
not permitted).