Class ConfigTable

java.lang.Object
  |
  +--SimpleTable
        |
        +--Table
              |
              +--ConfigTable

class ConfigTable
extends Table

This reads the Config file as a tab-delimited table to define the initial Configi state. Later, these values may be overiden by GetParams or by user interaction via the menu. It reads the MaExplorerConfig.txt table from FILE/URL. This whole file is a tab-delimited file consisting of the following fields: (Parameter, Value, DataType, Comments).

 Table to map User Table and Field to MAExplorer Table and Field
 Config file entries of the form:
   Parameter= "mapTF"
   Value= "maeTname,maeFname,usrTname,usrFname"

 Eg.  "GenomicIDdata,Clone_ID,GIPOdata,Clone Id"
This table is set up here and invoked immediately after a table is read to remap the names so the MAE names can be used within MAExplorer.

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/.

Version:
$Date: 2002/12/11 17:23:21 $ $Revision: $
Author:
P. Lemkin (NCI), G. Thornwall (SAIC), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home, Config, Table

Field Summary
(package private)  boolean hasValidData
          flag: set if data was read ok
(package private)  int idxComments
          optional comments
(package private)  int idxDataType
          i.e "int", "boolean" or "float"
(package private)  int idxParameter
          parameter string name
(package private)  int idxValue
          value of parameter
private  java.lang.String[] mapMFname
          [map 0:nMUmap-1] names of MAE Field
private  java.lang.String[] mapMTname
          map [0:nMUmap-1] names of MAE Table
private  java.lang.String[] mapUFname
          map 0:nMUmap-1] names of User Field
private  java.lang.String[] mapUTname
          map [0:nMUmap-1] names of User Table
private static int MAX_MU_MAP
          max # of (maeTable, maeField) to (userTable, userField) map entries
(package private)  int nMUmap
          # of map entries
 
Fields inherited from class Table
bufSize, fileOKflag, fio, mae
 
Fields inherited from class SimpleTable
fileName, msg, tCols, tData, tFields, title, tRows
 
Constructor Summary
(package private) ConfigTable(MAExplorer mae, java.lang.String fileName)
          ConfigTable() - constructor to read the configuration table file.
 
Method Summary
(package private)  java.lang.String[] getConfigRowByRowIdx(int tableRow)
          getConfigRowByRowIdx() - get row of Config data table Row
(package private)  java.lang.String getConfigRowFieldByName(int tableRow, java.lang.String fieldName)
          getConfigRowFieldByName() - get row field data by array coords
(package private)  java.lang.String getConfigRowFieldByRowFieldIdxes(int rowIdx, int fieldIdx)
          getConfigRowFieldByRowFieldIdxses() - get row field by row and field indices
(package private)  java.lang.String getConfigRowFieldByRowNameIdx(int idx, java.lang.String fieldName)
          getConfigRowFieldByRowIdxName() - get row field by row index and name
(package private)  java.lang.String getNthValueByName(java.lang.String name, int n)
          getNthValueByName() - get n'th Configuration table Value by Name
(package private)  java.lang.String[] getTableRowByParameter(java.lang.String param)
          getTableRowByParameter() - get row of Configuration table data by Parameter
(package private)  java.lang.String getValueByName(java.lang.String name)
          getValueByName() - get Configuration table Value by Name
(package private)  java.lang.String mapUsrFieldToMaeField(java.lang.String usrTbl, java.lang.String usrField)
          mapUsrFieldToMaeField() - map user (Tbl,Field) name to MAE Field name
(package private)  void setupFieldIndexes()
          setupFieldIndexes() - setup indexes for commonly found fields.
private  void setupTableFieldNameMap()
          setupTableFieldNameMap() - map user to MAE field names
 
Methods inherited from class Table
copyTable, createFileTable, getArrayOfTabDelimitedTokens, getData, getTableRowsSubset, getTableRowsSubset, insertTblInULHCtable, lookupFieldIdxAndRemapFieldName, makeTabDelimReport, readTable, storeDataBufParser
 
Methods inherited from class SimpleTable
freeTable, getTableRowFieldByRowIdx, getTableRowFieldIdxByRowIdx, lookupFieldIdx, setFieldData, setRowData, trimWhitespace
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

idxParameter

int idxParameter
parameter string name

idxValue

int idxValue
value of parameter

idxDataType

int idxDataType
i.e "int", "boolean" or "float"

idxComments

int idxComments
optional comments

MAX_MU_MAP

private static final int MAX_MU_MAP
max # of (maeTable, maeField) to (userTable, userField) map entries

mapMTname

private java.lang.String[] mapMTname
map [0:nMUmap-1] names of MAE Table

mapMFname

private java.lang.String[] mapMFname
[map 0:nMUmap-1] names of MAE Field

mapUTname

private java.lang.String[] mapUTname
map [0:nMUmap-1] names of User Table

mapUFname

private java.lang.String[] mapUFname
map 0:nMUmap-1] names of User Field

nMUmap

int nMUmap
# of map entries

hasValidData

boolean hasValidData
flag: set if data was read ok
Constructor Detail

ConfigTable

ConfigTable(MAExplorer mae,
            java.lang.String fileName)
ConfigTable() - constructor to read the configuration table file.
Parameters:
mae - is the MAExplorer instance
fileName - is the full path filename for configuation file
See Also:
setupFieldIndexes(), setupTableFieldNameMap()
Method Detail

setupFieldIndexes

void setupFieldIndexes()
setupFieldIndexes() - setup indexes for commonly found fields. We use indexes to speed up the table access.
See Also:
SimpleTable.lookupFieldIdx(java.lang.String)

setupTableFieldNameMap

private void setupTableFieldNameMap()
setupTableFieldNameMap() - map user to MAE field names
   Parameter= "mapTF"
   Value= "maeTname,maeFname,usrTname,usrFname"
See Also:
Util.cvs2Array(java.lang.String, int, java.lang.String), getNthValueByName(java.lang.String, int)

mapUsrFieldToMaeField

java.lang.String mapUsrFieldToMaeField(java.lang.String usrTbl,
                                       java.lang.String usrField)
mapUsrFieldToMaeField() - map user (Tbl,Field) name to MAE Field name
Parameters:
usrTbl - is the user's name for the table
usrField - is the user's name for the field
Returns:
usrField if can't find it

getConfigRowByRowIdx

java.lang.String[] getConfigRowByRowIdx(int tableRow)
getConfigRowByRowIdx() - get row of Config data table Row
Parameters:
tableRow - to get data
Returns:
row of data else null if can't find it

getConfigRowFieldByName

java.lang.String getConfigRowFieldByName(int tableRow,
                                         java.lang.String fieldName)
getConfigRowFieldByName() - get row field data by array coords
Parameters:
tableRow - to get data
fieldName - to get data
Returns:
field data else null if can't find it
See Also:
SimpleTable.lookupFieldIdx(java.lang.String)

getConfigRowFieldByRowNameIdx

java.lang.String getConfigRowFieldByRowNameIdx(int idx,
                                               java.lang.String fieldName)
getConfigRowFieldByRowIdxName() - get row field by row index and name
Parameters:
idx - is row index to get data
fieldName - to get data
Returns:
field data else null if can't find it
See Also:
SimpleTable.getTableRowFieldByRowIdx(int, java.lang.String)

getConfigRowFieldByRowFieldIdxes

java.lang.String getConfigRowFieldByRowFieldIdxes(int rowIdx,
                                                  int fieldIdx)
getConfigRowFieldByRowFieldIdxses() - get row field by row and field indices
Parameters:
rowIdx - is row index to get data
fieldIdx - is field index to get data
Returns:
field data else null if can't find it

getTableRowByParameter

java.lang.String[] getTableRowByParameter(java.lang.String param)
getTableRowByParameter() - get row of Configuration table data by Parameter
Parameters:
param - to use to search DB
Returns:
data else null if failed.

getValueByName

java.lang.String getValueByName(java.lang.String name)
getValueByName() - get Configuration table Value by Name
Parameters:
name - of parameter to get data
Returns:
data else null if failed.

getNthValueByName

java.lang.String getNthValueByName(java.lang.String name,
                                   int n)
getNthValueByName() - get n'th Configuration table Value by Name
Parameters:
name - of parameter to get data
n - is the n'th instance of the name to get
Returns:
data else null if failed.
See Also:
getValueByName(java.lang.String)