public class TwoDimTable extends Iced
Modifier and Type | Field and Description |
---|---|
static double |
emptyDouble |
Constructor and Description |
---|
TwoDimTable(java.lang.String tableHeader,
java.lang.String tableDescription,
java.lang.String[] rowHeaders,
java.lang.String[] colHeaders,
java.lang.String[] colTypes,
java.lang.String[] colFormats,
java.lang.String colHeaderForRowHeaders)
Constructor for TwoDimTable (R rows, C columns)
|
TwoDimTable(java.lang.String tableHeader,
java.lang.String tableDescription,
java.lang.String[] rowHeaders,
java.lang.String[] colHeaders,
java.lang.String[] colTypes,
java.lang.String[] colFormats,
java.lang.String colHeaderForRowHeaders,
java.lang.String[][] strCellValues,
double[][] dblCellValues)
Constructor for TwoDimTable (R rows, C columns)
|
Modifier and Type | Method and Description |
---|---|
Frame |
asFrame(Key frameKey) |
java.lang.Object |
get(int row,
int col)
Accessor for table cells
|
IcedWrapper[][] |
getCellValues() |
int |
getColDim()
Get col dimension
|
java.lang.String[] |
getColFormats() |
java.lang.String |
getColHeaderForRowHeaders() |
java.lang.String[] |
getColHeaders() |
java.lang.String[] |
getColTypes() |
int |
getRowDim()
Get row dimension
|
java.lang.String[] |
getRowHeaders() |
java.lang.String |
getTableDescription() |
java.lang.String |
getTableHeader() |
static boolean |
isEmpty(double d)
Check whether a double value is considered an "empty field".
|
void |
set(int row,
int col,
java.lang.Object o)
Setter for table cells
|
void |
setTableHeader(java.lang.String newHeader)
Need to change table header when we are calling GLRM from PCA.
|
java.lang.String |
toString()
Print table to String, using 2 spaces for padding between columns
|
java.lang.String |
toString(int pad)
Print table to String, using user-given padding
|
java.lang.String |
toString(int pad,
boolean full)
Print table to String, using user-given padding
|
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonBytes, toJsonString, write, writeExternal, writeJSON
public static final double emptyDouble
public TwoDimTable(java.lang.String tableHeader, java.lang.String tableDescription, java.lang.String[] rowHeaders, java.lang.String[] colHeaders, java.lang.String[] colTypes, java.lang.String[] colFormats, java.lang.String colHeaderForRowHeaders)
tableHeader
- the table headertableDescription
- the table descriptionrowHeaders
- R-dim array for row headerscolHeaders
- C-dim array for column headerscolTypes
- C-dim array for column typescolFormats
- C-dim array with printf format strings for each columncolHeaderForRowHeaders
- column header for row headerspublic TwoDimTable(java.lang.String tableHeader, java.lang.String tableDescription, java.lang.String[] rowHeaders, java.lang.String[] colHeaders, java.lang.String[] colTypes, java.lang.String[] colFormats, java.lang.String colHeaderForRowHeaders, java.lang.String[][] strCellValues, double[][] dblCellValues)
tableHeader
- the table headertableDescription
- the table descriptionrowHeaders
- R-dim array for row headerscolHeaders
- C-dim array for column headerscolTypes
- C-dim array for column typescolFormats
- C-dim array with printf format strings for each columncolHeaderForRowHeaders
- column header for row headersstrCellValues
- String[R][C] array for string cell values, can be null (can provide String[R][], for example)dblCellValues
- double[R][C] array for double cell values, can be empty (marked with emptyDouble - happens when initialized with double[R][])public static boolean isEmpty(double d)
d
- a double valuepublic java.lang.Object get(int row, int col)
row
- a row indexcol
- a column indexpublic java.lang.String getTableHeader()
public java.lang.String getTableDescription()
public java.lang.String[] getRowHeaders()
public java.lang.String[] getColHeaders()
public java.lang.String getColHeaderForRowHeaders()
public java.lang.String[] getColTypes()
public java.lang.String[] getColFormats()
public IcedWrapper[][] getCellValues()
public int getRowDim()
public int getColDim()
public void setTableHeader(java.lang.String newHeader)
newHeader:
- String containing new table header.public void set(int row, int col, java.lang.Object o)
row
- a row indexcol
- a column indexo
- Object valuepublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int pad)
pad
- number of spaces for padding between columnspublic java.lang.String toString(int pad, boolean full)
pad
- number of spaces for padding between columnsfull
- whether to print the full table (otherwise top 5 and bottom 5 rows only)