public class FlexibleTable extends java.lang.Object implements MatrixTable
| Constructor and Description |
|---|
FlexibleTable(FlexibleTable that)
Copy constructor.
|
FlexibleTable(int nRows,
int nCols)
Construct a table using default labeling.
|
FlexibleTable(java.lang.Object[] rowLabels,
java.lang.Object[] colLabels)
Construct a table by row and column labels, initializing the content to 0.
|
FlexibleTable(java.lang.Object[] rowLabels,
java.lang.Object[] colLabels,
double[][] cells)
Construct a flexible table that can shrink or grow.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addColAt(int i)
Add a column at i.
|
void |
addColAt(int i,
java.lang.Object label)
Add a column at i.
|
void |
addRowAt(int i)
Add a row at i.
|
void |
addRowAt(int i,
java.lang.Object label)
Add a row at i.
|
void |
deleteCol(int i)
Delete column i.
|
void |
deleteRow(int i)
Delete row i.
|
boolean |
equals(java.lang.Object obj) |
double |
get(int i,
int j)
Get the matrix entry at [i,j].
|
java.lang.Object |
getColLabel(int i)
Get the label for column i.
|
Vector |
getColumn(int col) |
int |
getIndexFromColLabel(java.lang.Object label)
Translate a column label to a column index.
|
int |
getIndexFromRowLabel(java.lang.Object label)
Translate a row label to a row index.
|
Vector |
getRow(int row) |
java.lang.Object |
getRowLabel(int i)
Get the label for row i.
|
int |
hashCode() |
int |
nCols()
Get the number of columns.
|
int |
nRows()
Get the number of rows.
|
void |
renameCol(int i,
java.lang.Object label)
Rename column i.
|
void |
renameRow(int i,
java.lang.Object label)
Rename row i.
|
void |
set(int i,
int j,
double value)
Set the matrix entry at [i,j] to a value.
|
DenseMatrix |
toMatrix()
Get a copy of the flexible table in the form of a matrix.
|
java.lang.String |
toString() |
public FlexibleTable(java.lang.Object[] rowLabels,
java.lang.Object[] colLabels,
double[][] cells)
rowLabels - the row labelscolLabels - the column labelscells - the table contentpublic FlexibleTable(java.lang.Object[] rowLabels,
java.lang.Object[] colLabels)
rowLabels - the row labelscolLabels - the column labelspublic FlexibleTable(int nRows,
int nCols)
nRows - number of rowsnCols - number of columnspublic FlexibleTable(FlexibleTable that)
that - another FlexibleTablepublic int nRows()
Tablepublic int nCols()
Tablepublic void set(int i,
int j,
double value)
MatrixAccessset in interface MatrixAccessi - the row indexj - the column indexvalue - the value to set A[i,j] topublic double get(int i,
int j)
MatrixAccessget in interface MatrixAccessi - the row indexj - the column indexpublic Vector getRow(int row) throws MatrixAccessException
MatrixAccessExceptionpublic Vector getColumn(int col) throws MatrixAccessException
MatrixAccessExceptionpublic int getIndexFromRowLabel(java.lang.Object label)
label - a row labelpublic int getIndexFromColLabel(java.lang.Object label)
label - a column labelpublic java.lang.Object getRowLabel(int i)
i - a row index, counting from 1public java.lang.Object getColLabel(int i)
i - a column index, counting from 1public void renameRow(int i,
java.lang.Object label)
i - a row index, counting from 1label - the new labelpublic void renameCol(int i,
java.lang.Object label)
i - a column index, counting from 1label - the new labelpublic void deleteRow(int i)
i - a row index, counting from 1public void deleteCol(int i)
i - a column index, counting from 1public void addRowAt(int i,
java.lang.Object label)
i - the row index, counting from 1label - the row labelpublic void addRowAt(int i)
i - the row index, counting from 1public void addColAt(int i,
java.lang.Object label)
i - the column index, counting from 1label - the column labelpublic void addColAt(int i)
i - the column index, counting from 1public DenseMatrix toMatrix()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object