|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object O2Plib.table.SimpleTable O2Plib.table.Table
public class Table
Class Table creates a table object with no data or data read from a tab-delimited file. It extends 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 AccFileIO.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 | |
---|---|
int |
bufSize
size of input buffer when read file |
boolean |
errFlag
Error message Flag |
java.lang.String |
errMsg
Error message string if not null |
boolean |
fileOKflag
File exists and was able to be read |
static Table[] |
tblList
List of all Tables's [0:tblListSize-1]. |
static int |
tblListSize
size of the tableList. |
Fields inherited from class O2Plib.table.SimpleTable |
---|
dbugFlag, fullFileName, name, tCols, tData, tFields, tHelp, title, tRows, tType |
Constructor Summary | |
---|---|
Table()
Table() - constructor for creating table from file. |
|
Table(int nRows,
int nCols,
java.lang.String title)
Table() - constructor for creating empty table of (nRows,nCols). |
|
Table(SimpleTable st)
Table() - constructor for creating table from a SimpleTable Errors are in (errMsg, errFlag). |
|
Table(java.lang.String fileName)
Table() - constructor for creating table from file. |
|
Table(java.lang.String fileName,
java.lang.String[] overideFieldNames,
boolean dontReadHeaderLineFlag)
Table() - constructor for creating table from file. |
|
Table(java.lang.String title,
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. |
|
Table(java.lang.String title,
java.lang.String fileName,
java.lang.String[] tFields,
int tRows,
int tCols)
Table() - constructor for creating empty table. |
|
Table(java.lang.String title,
java.lang.String fileName,
java.lang.String type,
boolean add2TblListFlag)
Table() - constructor for creating empty table. |
Method Summary | |
---|---|
boolean |
addTableToTableList()
addTableToTableList() - add Table to tblList. |
static void |
clearTableList()
clearTableList() - clear the table List of all instances. |
Table |
copyTable(SimpleTable st)
copyTable() - copy SimpleTable data to this Table. |
private boolean |
createFileTable(java.lang.String fileName,
java.lang.String[] overideFieldNames,
boolean dontReadHeaderLineFlag)
createFileTable() - create table from file on this Table. |
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[] overideFieldNames,
boolean dontReadHeaderLineFlag)
getData() - read the data and store it in the table. |
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) |
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[]. |
SimpleTable |
insertTblInULHCtable(int nRows,
int nCols,
java.lang.String nTitle)
insertTblInULHCtable() - insert table into U.L.H.C. |
static Table |
lookupTableByName(java.lang.String tableName)
lookupTableByName() - lookup the table by name |
static int |
lookupTableListIdxByTableName(java.lang.String tableName)
lookupTableListIdxByTableName() - lookup TableList[] index by Table name if the name is in the table list. |
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)
readTable() - read a tab-delimited table from FILE/URL. |
boolean |
rmvTableFromTableList()
rmvTableFromTableList() - remove Table from tblList |
private boolean |
storeDataBufParser(java.lang.String rawData,
java.lang.String[] overideFieldNames,
boolean dontReadHeaderLineFlag)
storeDataBufParser() - Put data into Table tData[r][c] and tFields[c], given a String from the whole file. |
boolean |
writeTableDelim(java.lang.String fileName,
java.lang.String delim)
writeTableDelim() - Write the table as a delimited character or string file. |
boolean |
writeTableXML(java.lang.String fileName,
java.lang.String topObj,
java.lang.String dateStr,
java.lang.String dbName,
java.lang.String entryObj)
writeTableXML() - Write the table as an XML file. |
boolean |
writeTableXML(java.lang.String fileName,
java.lang.String topObj,
java.lang.String dateStr,
java.lang.String dbName,
java.lang.String entryObj,
java.lang.String dtdFile)
writeTableXML() - Write the table as an XML file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Table[] tblList
public static int tblListSize
public boolean fileOKflag
public int bufSize
public java.lang.String errMsg
public boolean errFlag
Constructor Detail |
---|
public Table()
fileName
- is file name to read into Table instancepublic Table(java.lang.String fileName)
fileName
- is file name to read into Table instancepublic Table(java.lang.String fileName, java.lang.String[] overideFieldNames, boolean dontReadHeaderLineFlag)
fileName
- is file name to read into Table instanceoverideFieldNames
- 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(java.lang.String, java.lang.String[], boolean)
public Table(int nRows, int nCols, java.lang.String title)
nRows
- is the size of table to createnCols
- is the size of table to createfileName
- is file name to read into Table instancepublic Table(java.lang.String title, java.lang.String fileName, java.lang.String type, boolean add2TblListFlag)
title
- opt. title of the tablefileName
- opt. file name assoc. w/tabletype
- of the tableadd2TblListFlag
- to tblList[] if truepublic Table(java.lang.String title, java.lang.String fileName, java.lang.String[] tFields, int tRows, int tCols)
title
- opt. title of the tablefileName
- opt. file name assoc. w/tabletFields
- is list of field names [0:tCols-1]tRows
- # of rows in tabletCols
- # of Field columns in table.public Table(java.lang.String title, java.lang.String fileName, int tRows, int tCols, java.lang.String[] tFields, java.lang.String[][] tData)
title
- opt. title of the tablefileName
- opt. file name assoc. w/tabletRows
- # of rows in tabletCols
- # of Field columns in table.tFields
- field names of the tabletData
- rows of datapublic Table(SimpleTable st)
st
- is a Simple table instance.copyTable(O2Plib.table.SimpleTable)
Method Detail |
---|
private boolean createFileTable(java.lang.String fileName, java.lang.String[] overideFieldNames, boolean dontReadHeaderLineFlag)
fileName
- is file name to read into Table instanceoverideFieldNames
- 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 fields
getData(java.lang.String, java.lang.String[], boolean)
,
storeDataBufParser(java.lang.String, java.lang.String[], boolean)
private boolean getData(java.lang.String fileName, java.lang.String[] overideFieldNames, boolean dontReadHeaderLineFlag)
fileName
- is file name to read into Table instanceoverideFieldNames
- 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 fields
readTable(java.lang.String)
,
storeDataBufParser(java.lang.String, java.lang.String[], boolean)
public 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[] overideFieldNames, boolean dontReadHeaderLineFlag)
rawData
- is data to be parsed into a TableoverideFieldNames
- 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 fields
private java.lang.String readTable(java.lang.String fileName)
fileName
- is file name to read
public 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 title
SimpleTable.lookupFieldIdx(java.lang.String)
,
Table
public 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 title
SimpleTable
,
SimpleTable.lookupFieldIdx(java.lang.String)
public java.lang.String makeTabDelimReport(java.lang.String title)
title
- to put at top of the string report
public SimpleTable 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 title
SimpleTable
public Table copyTable(SimpleTable st)
st
- is SimpleTable to copy into a Table
public static void clearTableList()
public boolean addTableToTableList()
tbl
- is Table to add to list
public boolean rmvTableFromTableList()
tbl
- is Table to remove from the list
public static Table lookupTableByName(java.lang.String tableName)
tableName
- to search for
public static int lookupTableListIdxByTableName(java.lang.String tableName)
tableName
- to search for
public boolean writeTableDelim(java.lang.String fileName, java.lang.String delim)
fileName
- is the full path name of the output filedelim
- is the delimiter string (or character)
public boolean writeTableXML(java.lang.String fileName, java.lang.String topObj, java.lang.String dateStr, java.lang.String dbName, java.lang.String entryObj, java.lang.String dtdFile)
fileName
- is the full path name of the output filetopObj
- is the name of the top level objectdateStr
- is the date created if not nulldbName
- is the name of the database if not nullentryObj
- is the name of a row entry objectdtdFile
- is the DTD file (if not null, insert the DTD if it exists)
public boolean writeTableXML(java.lang.String fileName, java.lang.String topObj, java.lang.String dateStr, java.lang.String dbName, java.lang.String entryObj)
fileName
- is the full path name of the output filetopObj
- is the name of the top level objectdateStr
- is the date created if not nulldbName
- is the name of the database if not nullentryObj
- is the name of a row entry object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |