|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--SimpleTable
The SimpleTable class creates an empty table of size tRows and tCols. It is up to the caller to populate the table. It contains several methods for accessing data in the table.
List of access methods SimpleTable() - constructor for creating empty table SimpleTable() - constructor for creating a table popupated with fields and data freeTable() - free Table tData[][] and tFields so can garbage collect it trimWhitespace() - trim Table tData[][] and tFields[] data setFieldData() - set new field[] list for table setRowData() - set new row data[] for specific row in the table lookupFieldIdx() - lookup column index of field if exists getTableRowFieldByRowIdx() - get field in row by Table row index getTableRowFieldIdxByRowIdx() - get data by field idx with row index
This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.
Table
Field Summary | |
java.lang.String |
fileName
Optional file name associated with table |
java.lang.String |
msg
Optional message associated with table |
int |
tCols
# of columns/row in the table |
java.lang.String[][] |
tData
row vectors of data [0:tRows-1][0:tCols-1] |
java.lang.String[] |
tFields
names of table fields |
java.lang.String |
title
Optional title of table |
int |
tRows
# of rows/Table |
Constructor Summary | |
SimpleTable()
SimpleTable() - constructor for creating empty table. |
|
SimpleTable(java.lang.String title,
java.lang.String msg,
java.lang.String fileName,
int tRows,
int tCols)
|
|
SimpleTable(java.lang.String title,
java.lang.String msg,
java.lang.String fileName,
int tRows,
int tCols,
java.lang.String[] tFields,
java.lang.String[][] tData)
SimpleTable() - constructor for creating a table popupated with fields and data. |
Method Summary | |
void |
freeTable()
freeTable() - free Table tData[][] and tFields so can garbage collect it Also zero tRows, tCols |
java.lang.String |
getTableRowFieldByRowIdx(int idx,
java.lang.String fieldName)
getTableRowFieldByRowIdx() - get field in row by Table row index |
java.lang.String |
getTableRowFieldIdxByRowIdx(int rowIdx,
int fieldIdx)
getTableRowFieldIdxByRowIdx() - get data by field idx with row index |
int |
lookupFieldIdx(java.lang.String fieldName)
lookupFieldIdx() - lookup column index of field if exists. |
boolean |
setFieldData(java.lang.String[] newFields,
int nNewFields)
setFieldData() - set new field[] list for table |
boolean |
setRowData(java.lang.String[] newRowData,
int nFields,
int rowNbr)
setRowData() - set new row data[] for specific row in the table |
void |
trimWhitespace()
trimWhitespace() - trim Table tData[][] and tFields[] data. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public int tCols
public int tRows
public java.lang.String[] tFields
public java.lang.String[][] tData
public java.lang.String title
public java.lang.String msg
public java.lang.String fileName
Constructor Detail |
public SimpleTable()
public SimpleTable(java.lang.String title, java.lang.String msg, java.lang.String fileName, int tRows, int tCols)
public SimpleTable(java.lang.String title, java.lang.String msg, java.lang.String fileName, int tRows, int tCols, java.lang.String[] tFields, java.lang.String[][] tData)
title
- opt. title of the tablemsg
- opt. message assoc. w/tablefileName
- opt. file name assoc. w/tabletRows
- # of rows in tabletCols
- # of Field columns in table.tFields
- field names of the tabletData
- rows of dataMethod Detail |
public void freeTable()
public void trimWhitespace()
public boolean setFieldData(java.lang.String[] newFields, int nNewFields)
newFields
- is list of new fieldspublic boolean setRowData(java.lang.String[] newRowData, int nFields, int rowNbr)
newRowData
- is list of new data for row rowNbrrowNbr
- is the row to changepublic int lookupFieldIdx(java.lang.String fieldName)
fieldName
- to lookuppublic java.lang.String getTableRowFieldByRowIdx(int idx, java.lang.String fieldName)
idx
- is field (i.e. column) to usefieldName
- to lookuplookupFieldIdx(java.lang.String)
public java.lang.String getTableRowFieldIdxByRowIdx(int rowIdx, int fieldIdx)
rowIdx
- is field (i.e. column) to usefieldIdx
- of field to to lookup
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |