public class Table<RowHeaderType,ColumnHeaderType,ValueType>
extends java.lang.Object
Constructor and Description |
---|
Table(java.util.List<RowHeaderType> rowHeaders,
java.util.List<ColumnHeaderType> columnHeaders)
Constructs a Table with the specified row and column headers.
|
Modifier and Type | Method and Description |
---|---|
ValueType |
get(RowHeaderType r,
ColumnHeaderType c)
Returns the value to which the specified row and column is mapped in this
table.
|
void |
set(RowHeaderType r,
ColumnHeaderType c,
ValueType v)
Maps the specified row and column to the specified value in the table.
|
java.lang.String |
toString() |
public Table(java.util.List<RowHeaderType> rowHeaders, java.util.List<ColumnHeaderType> columnHeaders)
rowHeaders
- a list of row headerscolumnHeaders
- a list of column headerspublic void set(RowHeaderType r, ColumnHeaderType c, ValueType v)
null
get
method with a
row and column that is equal to the original row and column.r
- the table rowc
- the table columnv
- the valuejava.lang.NullPointerException
- if the row, column, or value is null
.public ValueType get(RowHeaderType r, ColumnHeaderType c)
r
- a row in the tablec
- a column in the tablenull
if the row and column is not mapped to any
values in this table.java.lang.NullPointerException
- if the row or column is null
.public java.lang.String toString()
toString
in class java.lang.Object