R - the row key typeC - the column key typeT - the value type.public final class DefaultKeyedValues2D<R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>,T> extends java.lang.Object implements KeyedValues2D<R,C,T>, java.io.Serializable
| Constructor and Description |
|---|
DefaultKeyedValues2D()
Creates a new (empty) instance.
|
DefaultKeyedValues2D(java.util.List<R> rowKeys,
java.util.List<C> 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(C columnKey)
Returns the index corresponding to the specified column key.
|
C |
getColumnKey(int columnIndex)
Returns the column key corresponding to the specified index.
|
java.util.List<C> |
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(R rowKey)
Returns the index corresponding to the specified row key.
|
R |
getRowKey(int rowIndex)
Returns the row key corresponding to the specified index.
|
java.util.List<R> |
getRowKeys()
Returns a copy of the list of row keys.
|
T |
getValue(int rowIndex,
int columnIndex)
Returns the value from one cell in the table.
|
T |
getValue(R rowKey,
C columnKey)
Returns a value from one cell in the table.
|
void |
setValue(T n,
R rowKey,
C columnKey)
Sets a value for one cell in the table.
|
public DefaultKeyedValues2D()
public DefaultKeyedValues2D(java.util.List<R> rowKeys, java.util.List<C> columnKeys)
null.rowKeys - the xKeys (null not permitted).columnKeys - the yKeys (null not permitted).public R getRowKey(int rowIndex)
public C getColumnKey(int columnIndex)
getColumnKey in interface KeyedValues2D<R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>,T>columnIndex - the column index.public int getRowIndex(R rowKey)
getRowIndex in interface KeyedValues2D<R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>,T>rowKey - the row key (null not permitted).public int getColumnIndex(C columnKey)
getColumnIndex in interface KeyedValues2D<R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>,T>columnKey - the column key (null not permitted).public java.util.List<R> getRowKeys()
getRowKeys in interface KeyedValues2D<R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>,T>null).public java.util.List<C> getColumnKeys()
getColumnKeys in interface KeyedValues2D<R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>,T>null).public int getRowCount()
getRowCount in interface Values2D<T>public int getColumnCount()
getColumnCount in interface Values2D<T>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, R rowKey, C 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