public class KeyedListsTable
extends java.lang.Object
implements org.jfree.data.KeyedValues2D, java.lang.Cloneable, java.io.Serializable
| Constructor and Description |
|---|
KeyedListsTable()
Creates a new table.
|
KeyedListsTable(boolean sortRowKeys)
Creates a new table.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToList(java.lang.Object element,
java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
Adds a element to a list.
|
void |
clear()
Clears all the data and associated keys.
|
int |
getColumnCount()
Returns the column count.
|
int |
getColumnIndex(java.lang.Comparable key)
Returns the column index for a given key.
|
java.lang.Comparable |
getColumnKey(int column)
Returns the key for a given column.
|
java.util.List |
getColumnKeys()
Returns the column keys in an unmodifiable list.
|
java.util.List |
getList(java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
Returns the List for the given row and column keys.
|
int |
getRowCount()
Returns the row count.
|
int |
getRowIndex(java.lang.Comparable key)
Returns the row index for a given key.
|
java.lang.Comparable |
getRowKey(int row)
Returns the key for a given row.
|
java.util.List |
getRowKeys()
Returns the row keys in an unmodifiable list.
|
java.lang.Number |
getValue(java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
Returns the value for the given row and column keys.
|
java.lang.Number |
getValue(int row,
int column)
Returns the value for a given row and column.
|
void |
removeColumn(java.lang.Comparable columnKey)
Removes a column.
|
void |
removeColumn(int columnIndex)
Removes a column.
|
void |
removeFromList(java.lang.Object element,
java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
Removes an element from the table.
|
void |
removeList(java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
Removes a value from the table by setting it to
null. |
void |
removeRow(java.lang.Comparable rowKey)
Removes a row.
|
void |
removeRow(int rowIndex)
Removes a row.
|
void |
setList(java.util.List list,
java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
Adds or updates a list.
|
public KeyedListsTable()
public KeyedListsTable(boolean sortRowKeys)
sortRowKeys - if the row keys should be sorted.public java.util.List getList(java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
rowKey - the row key (null not permitted).columnKey - the column key (null not permitted).null).public void setList(java.util.List list,
java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
list - the list (null permitted).rowKey - the row key (null not permitted).columnKey - the column key (null not permitted).public void addToList(java.lang.Object element,
java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
element - the element to add (null permitted).rowKey - the row key (null not permitted).columnKey - the column key (null not permitted).public void removeList(java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
null. If
all the values in the specified row and/or column are now
null, the row and/or column is removed from the table.rowKey - the row key (null not permitted).columnKey - the column key (null not permitted).public void removeFromList(java.lang.Object element,
java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
null. If all the values in the specified row and/or
column are now null, the row and/or column is removed
from the table.rowKey - the row key (null not permitted).columnKey - the column key (null not permitted).public void removeRow(int rowIndex)
rowIndex - the row index.public void removeRow(java.lang.Comparable rowKey)
null, the
column(s) is/are removed.rowKey - the row key (null not permitted).public void removeColumn(int columnIndex)
columnIndex - the column index.public void removeColumn(java.lang.Comparable columnKey)
columnKey - the column key (null not permitted).public void clear()
public int getRowCount()
getRowCount in interface org.jfree.data.Values2Dpublic int getColumnCount()
getColumnCount in interface org.jfree.data.Values2Dpublic java.lang.Number getValue(int row,
int column)
getValue in interface org.jfree.data.Values2Drow - the row index.column - the column index.public java.lang.Number getValue(java.lang.Comparable rowKey,
java.lang.Comparable columnKey)
getValue in interface org.jfree.data.KeyedValues2DrowKey - the row key (null not permitted).columnKey - the column key (null not permitted).null).public java.lang.Comparable getRowKey(int row)
getRowKey in interface org.jfree.data.KeyedValues2Drow - the row index (in the range 0 to getRowCount() - 1).public int getRowIndex(java.lang.Comparable key)
getRowIndex in interface org.jfree.data.KeyedValues2Dkey - the key (null not permitted).public java.util.List getRowKeys()
getRowKeys in interface org.jfree.data.KeyedValues2Dpublic java.lang.Comparable getColumnKey(int column)
getColumnKey in interface org.jfree.data.KeyedValues2Dcolumn - the column (in the range 0 to getColumnCount() -
1).public int getColumnIndex(java.lang.Comparable key)
getColumnIndex in interface org.jfree.data.KeyedValues2Dkey - the key (null not permitted).public java.util.List getColumnKeys()
getColumnKeys in interface org.jfree.data.KeyedValues2D