|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--SimpleTable | +--Table
This class creates a table object with no data or data read from a tab-delimited file. It extens SimpleTable. In turn, Table is the base class for other Table object extensions. Note: I/O is not done in this class but rather in FileIO.java.
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/.
ConfigTable
,
GipoTable
,
MaHPquantTable
,
SamplesTable
Field Summary | |
(package private) int |
bufSize
size of input buffer when read file |
(package private) boolean |
fileOKflag
File exists and was able to be read |
private FileIO |
fio
link to global instance of FileIO |
(package private) MAExplorer |
mae
link to global instance of MAExplorer |
Fields inherited from class SimpleTable |
fileName, msg, tCols, tData, tFields, title, tRows |
Constructor Summary | |
(package private) |
Table(MAExplorer mae,
int nRows,
int nCols,
java.lang.String title,
java.lang.String msg)
Table() - constructor for creating empty table of (nRows,nCols). |
(package private) |
Table(MAExplorer mae,
java.lang.String fileName,
java.lang.String msg)
Table() - constructor for creating table from file |
(package private) |
Table(MAExplorer mae,
java.lang.String fileName,
java.lang.String msg,
java.lang.String[] overideFieldNames,
boolean dontReadHeaderLineFlag)
Table() - constructor for creating table from file |
(package private) |
Table(SimpleTable st)
Table() - constructor for creating table from a SimpleTable |
Method Summary | |
(package private) Table |
copyTable(SimpleTable st)
copyTable() - copy SimpleTable data to this Table. |
private boolean |
createFileTable(MAExplorer mae,
java.lang.String fileName,
java.lang.String msg,
java.lang.String[] overideFieldNames,
boolean dontReadHeaderLineFlag)
createFileTable() - create table from file on this Table. |
(package private) java.lang.String[] |
getArrayOfTabDelimitedTokens(java.lang.String line,
int nCols)
getArrayOfTabDelimitedTokens() - get array of tab-delim tokens from table. |
private boolean |
getData(java.lang.String fileName,
java.lang.String msg,
java.lang.String[] overideFieldNames,
boolean dontReadHeaderLineFlag)
getData() - read the data and store it in the table. |
(package private) SimpleTable |
getTableRowsSubset(SimpleTable t,
java.lang.String key,
java.lang.String fieldName,
java.lang.String newTitle)
getTableRowsSubset() - make new table subset of table by (field,key) |
(package private) SimpleTable |
getTableRowsSubset(Table t,
java.lang.String[] fieldList,
java.lang.String[] newFieldList,
java.lang.String[] urlPrefix,
java.lang.String[] urlSuffix,
int nFields,
java.lang.String newTitle)
getTableRowsSubset() - make new table of specified fields by fieldList[] and in the order in which they appear in the fieldList[]. |
(package private) SimpleTable |
insertTblInULHCtable(int nRows,
int nCols,
java.lang.String nTitle)
insertTblInULHCtable() - insert table into U.L.H.C. |
(package private) int |
lookupFieldIdxAndRemapFieldName(java.lang.String maeTbl,
java.lang.String maeField)
lookupFieldIdxAndRemapFieldName() - lookup field idx and remap name if need to. |
(package private) java.lang.String |
makeTabDelimReport(java.lang.String title)
makeTabDelimReport() - make tab-delimited string report string from this Table |
private java.lang.String |
readTable(java.lang.String fileName,
java.lang.String msg)
readTable() - read a tab-delimited table from FILE/URL. |
private boolean |
storeDataBufParser(java.lang.String rawData,
java.lang.String msg,
java.lang.String[] overideFieldNames,
boolean dontReadHeaderLineFlag)
storeDataBufParser() - Put data into Table tData[r][c] and tFields[c], given a String from the whole file. |
Methods inherited from class SimpleTable |
freeTable, getTableRowFieldByRowIdx, getTableRowFieldIdxByRowIdx, lookupFieldIdx, setFieldData, setRowData, trimWhitespace |
Methods inherited from class java.lang.Object |
|
Field Detail |
MAExplorer mae
private FileIO fio
boolean fileOKflag
int bufSize
Constructor Detail |
Table(MAExplorer mae, java.lang.String fileName, java.lang.String msg)
mae
- is MAExplorer instancefileName
- is file name to read into Table instancemsg
- is the loading messageFileIO.logMsgln(java.lang.String)
,
MAExplorer.logDRYROTerr(java.lang.String)
,
MAExplorer.percentDone()
,
Util.showMsg(java.lang.String)
,
getData(java.lang.String, java.lang.String, java.lang.String[], boolean)
,
storeDataBufParser(java.lang.String, java.lang.String, java.lang.String[], boolean)
Table(MAExplorer mae, java.lang.String fileName, java.lang.String msg, java.lang.String[] overideFieldNames, boolean dontReadHeaderLineFlag)
mae
- is MAExplorer instancefileName
- is file name to read into Table instancemsg
- is the loading messageoverideFieldNames
- is array of names to use for the file names
if not null, else use the names from the first line in the file.dontReadHeaderLineFlag
- if using the overideFieldNames[] data,
don't read the header line (treat it as data) and use the rest
of the fieldscreateFileTable(MAExplorer, java.lang.String, java.lang.String, java.lang.String[], boolean)
Table(MAExplorer mae, int nRows, int nCols, java.lang.String title, java.lang.String msg)
mae
- is MAExplorer instancenRows
- is the size of table to createnCols
- is the size of table to createfileName
- is file name to read into Table instancemsg
- is the loading messageTable(SimpleTable st)
st
- is a Simple table instance.copyTable(SimpleTable)
Method Detail |
private boolean createFileTable(MAExplorer mae, java.lang.String fileName, java.lang.String msg, java.lang.String[] overideFieldNames, boolean dontReadHeaderLineFlag)
mae
- is MAExplorer instancefileName
- is file name to read into Table instancemsg
- is the loading message if not nulloverideFieldNames
- is array of names to use for the file names
if not null, else use the names from the first line in the file.dontReadHeaderLineFlag
- if using the overideFieldNames[] data,
don't read the header line (treat it as data) and use the rest
of the fieldsFileIO.logMsgln(java.lang.String)
,
MAExplorer.logDRYROTerr(java.lang.String)
,
MAExplorer.percentDone()
,
Util.showMsg(java.lang.String)
,
getData(java.lang.String, java.lang.String, java.lang.String[], boolean)
,
storeDataBufParser(java.lang.String, java.lang.String, java.lang.String[], boolean)
private boolean getData(java.lang.String fileName, java.lang.String msg, java.lang.String[] overideFieldNames, boolean dontReadHeaderLineFlag)
fileName
- is file name to read into Table instancemsg
- is the loading messageoverideFieldNames
- is array of names to use for the file names
if not null, else use the names from the first line in the file.dontReadHeaderLineFlag
- if using the overideFieldNames[] data,
don't read the header line (treat it as data) and use the rest
of the fieldsFileIO.logMsgln(java.lang.String)
,
MAExplorer.percentDone()
,
Util.showMsg(java.lang.String)
,
readTable(java.lang.String, java.lang.String)
,
storeDataBufParser(java.lang.String, java.lang.String, java.lang.String[], boolean)
int lookupFieldIdxAndRemapFieldName(java.lang.String maeTbl, java.lang.String maeField)
maeTbl
- is table to lookupmaeField
- to findConfigTable.mapUsrFieldToMaeField(java.lang.String, java.lang.String)
,
SimpleTable.lookupFieldIdx(java.lang.String)
java.lang.String[] getArrayOfTabDelimitedTokens(java.lang.String line, int nCols)
line
- of tokens to parsenCols
- is the # of tokens to parse (may be less than actual #)private boolean storeDataBufParser(java.lang.String rawData, java.lang.String msg, java.lang.String[] overideFieldNames, boolean dontReadHeaderLineFlag)
rawData
- is data to be parsed into a Tablemsg
- is the converting msgoverideFieldNames
- is array of names to use for the file names
if not null, else use the names from the first line in the file.dontReadHeaderLineFlag
- if using the overideFieldNames[] data,
don't read the header line (treat it as data) and use the rest
of the fieldsMAExplorer.logDRYROTerr(java.lang.String)
,
Util.showMsg(java.lang.String)
private java.lang.String readTable(java.lang.String fileName, java.lang.String msg)
fileName
- is file name to readmsg
- is the converting msgFileIO.readData(java.lang.String, java.lang.String)
,
Util.showMsg(java.lang.String)
SimpleTable getTableRowsSubset(SimpleTable t, java.lang.String key, java.lang.String fieldName, java.lang.String newTitle)
t
- is the instance of a SimpleTable to subsetkey
- is the values to look forfieldName
- is the column field name to checknewTitle
- is the new table titleSimpleTable.lookupFieldIdx(java.lang.String)
,
Table
SimpleTable getTableRowsSubset(Table t, java.lang.String[] fieldList, java.lang.String[] newFieldList, java.lang.String[] urlPrefix, java.lang.String[] urlSuffix, int nFields, java.lang.String newTitle)
t
- is the instance of a SimpleTable to subsetfieldList
- is list of fields to usenewFieldList[]
- is names of new fields entries are not nullurlPrefix
- is URL entry prefixes for URL fields if not nullurlSuffix
- is URL entry suffixes if entry not nullnFields
- is # of new fieldsnewTitle
- is the new table titleSimpleTable
,
SimpleTable.lookupFieldIdx(java.lang.String)
java.lang.String makeTabDelimReport(java.lang.String title)
title
- to put at top of the string reportSimpleTable insertTblInULHCtable(int nRows, int nCols, java.lang.String nTitle)
nRows
- is the number of rows in the tablenCols
- is the number of columns in the tablenTitle
- is the new titleSimpleTable
Table copyTable(SimpleTable st)
st
- is SimpleTable to copy into a Table
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |