public final class DefaultKeyedValues2D<T> extends java.lang.Object implements KeyedValues2D<T>, java.io.Serializable
| Constructor and Description |
|---|
DefaultKeyedValues2D()
Creates a new (empty) instance.
|
DefaultKeyedValues2D(java.util.List<java.lang.Comparable<?>> rowKeys,
java.util.List<java.lang.Comparable<?>> columnKeys)
Creates a new instance with the specified keys and all data values
initialized to
null. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
int |
getColumnCount()
Returns the number of column keys in the data structure.
|
int |
getColumnIndex(java.lang.Comparable<?> columnKey)
Returns the index corresponding to the specified column key.
|
java.lang.Comparable<?> |
getColumnKey(int columnIndex)
Returns the column key corresponding to the specified index.
|
java.util.List<java.lang.Comparable<?>> |
getColumnKeys()
Returns a copy of the list of column keys.
|
double |
getDoubleValue(int rowIndex,
int columnIndex)
Returns the data item at the specified position as a double primitive.
|
int |
getRowCount()
Returns the number of row keys in the table.
|
int |
getRowIndex(java.lang.Comparable<?> rowKey)
Returns the index corresponding to the specified row key.
|
java.lang.Comparable<?> |
getRowKey(int rowIndex)
Returns the row key corresponding to the specified index.
|
java.util.List<java.lang.Comparable<?>> |
getRowKeys()
Returns a copy of the list of row keys.
|
T |
getValue(java.lang.Comparable<?> rowKey,
java.lang.Comparable<?> columnKey)
Returns a value from one cell in the table.
|
T |
getValue(int rowIndex,
int columnIndex)
Returns the value from one cell in the table.
|
void |
setValue(T n,
java.lang.Comparable<?> rowKey,
java.lang.Comparable<?> columnKey)
Sets a value for one cell in the table.
|
public DefaultKeyedValues2D()
public DefaultKeyedValues2D(java.util.List<java.lang.Comparable<?>> rowKeys, java.util.List<java.lang.Comparable<?>> columnKeys)
null.rowKeys - the xKeys (null not permitted).columnKeys - the yKeys (null not permitted).public java.lang.Comparable<?> getRowKey(int rowIndex)
getRowKey in interface KeyedValues2D<T>rowIndex - the row index.public java.lang.Comparable<?> getColumnKey(int columnIndex)
getColumnKey in interface KeyedValues2D<T>columnIndex - the column index.public int getRowIndex(java.lang.Comparable<?> rowKey)
getRowIndex in interface KeyedValues2D<T>rowKey - the row key (null not permitted).public int getColumnIndex(java.lang.Comparable<?> columnKey)
getColumnIndex in interface KeyedValues2D<T>columnKey - the column key (null not permitted).public java.util.List<java.lang.Comparable<?>> getRowKeys()
getRowKeys in interface KeyedValues2D<T>null).public java.util.List<java.lang.Comparable<?>> getColumnKeys()
getColumnKeys in interface KeyedValues2D<T>null).public int getRowCount()
getRowCount in interface Values2D<T>public int getColumnCount()
getColumnCount in interface Values2D<T>public T getValue(java.lang.Comparable<?> rowKey, java.lang.Comparable<?> columnKey)
getValue in interface KeyedValues2D<T>rowKey - the row-key (null not permitted).columnKey - the column-key (null not permitted).null).public T getValue(int rowIndex, int columnIndex)
public double getDoubleValue(int rowIndex, int columnIndex)
getValue(int, int) method returns null,
this method returns Double.NaN.getDoubleValue in interface Values2D<T>rowIndex - the row index.columnIndex - the column index.public void setValue(T n, java.lang.Comparable<?> rowKey, java.lang.Comparable<?> columnKey)
n - the value (null permitted).rowKey - the row key (null not permitted).columnKey - the column key (null not permitted).public boolean equals(java.lang.Object obj)
equals in class java.lang.Object