O2Plib.db.CSD
Class CSDRmap

java.lang.Object
  extended by O2Plib.db.CSD.CSDglb
      extended by O2Plib.db.CSD.CSDRmap
All Implemented Interfaces:
CSDlistInterface

public class CSDRmap
extends CSDglb
implements CSDlistInterface

Class CSDRmap contains the state Rmap information on the Composite Samples Database (CSD). It can be used to map Rspots in the Rsample to foreign spot ids and annotation..


 This file is derived from Open2Dprot, MAExplorer and GELLAB-II code.

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 Open2Dprot Mozilla and Legal files are available on http://Open2Dprot.sourceforge.net/.

Version:
$Date: 2005/12/09 15:04:26 $ $Revision: 1.10 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702

Field Summary
 java.lang.String[] foreignSpotName
          [0:nRmapSize-1] list of foreign spot names mapped by rspotNbr
 java.util.Hashtable foreignSpotName2RpotNbrHT
          map of foreign spot name to Rspot set #
static int glbIdRmapCounter
          Global Rmap ID counter
 int idRmap
          Rmap id for this instance
 boolean mapRspotToStdSpotFlag
          false is standard Rspot mapping, true is standard Foreign Fspot mapping
 int maxRmapSize
          The maximum # of spots in the preallocated map lists
 java.lang.String name
          Name of the condition
 int nRmapSize
          The # of spots in the map
 int[] rSampleSpotNbr2RspotNbr
          [0:nRmapSize-1] map of Rsample spot number to the Rspot set idNbr.
 CSDannotation[] rspotNbr2Annotation
          [0:nRmapSize-1] list of Rspot annotation objects if any.
 CSDRspot[] rspotNbr2Rspot
          [0:nRmapSize-1] map of a number Rspot id number to the Rspot set object.
 java.lang.String timeStamp
           
 java.lang.String title
          title information of condition.
static java.lang.String VERSION
          Version for this module
 
Fields inherited from class O2Plib.db.CSD.CSDglb
allSetSamples, AP, batchDir, BF_IS_LMS_SPOT, BF_ISVALIDSPOT, cacheDir, cdbIsOpenFlag, condListDB, CONSOLE_FLAG, CP, CSD_DBTYPE_CACHE, CSD_DBTYPE_RDBMS, CSD_DBTYPE_TAB_DELIM, CSD_DBTYPE_UNKNOWN, CSD_DBTYPE_XML, csdAcc, csdCache, csdCacheFile, csdDatabaseFile, csdFormatMode, csdIO, csdLMS, csdName, csdRdbmsFile, csdSizes, csdTabDelimFile, csdTotals, CSDversion, csdXMLfile, dataFiltersListDB, dateCreation, dateLastSession, dbRsample, dbSample, dbSamplesListDB, dbSPFlistsDB, dBugLMsetNbr, dBugPspotNbr, dBugRspotNbr, dBugSampleNbr, EP, epSetSamples, exprListsDB, GS, LM, MAX_NODE_SAFTY_FACTOR, mrl, nbrTimesInitialized, nCondListDB, nDataFiltersDB, needToSaveCSDdataFlag, NEVER, nExprListsDB, nOclDB, nodeSaftyFactor, normListDB, nRmapsDB, nRspotListsDB, nSamplesDB, nSPFfilesUsedDB, nSPFlistsDB, oclListDB, oclNameDB, PP, ppxDir, projDir, rdbmsDir, rMapsListDB, RSAMPLE, rspotListsDB, SAMPLE, sampleNamesDB, sampleNamesUsedDB, SP, tmpDir, US, useInternalDTDflag, wrkAnotation, wrkCalib, wrkERspot, wrkExpr, wrkSetSamples, xmlDir, xSetSamples, ySetSamples
 
Constructor Summary
CSDRmap()
          CSDRmap() - Constructor for new CSDRmap.
CSDRmap(java.lang.String name, java.lang.String timeStamp, java.lang.String title)
          CSDRmap() - Constructor for new CSDRmap.
 
Method Summary
 boolean add(int rspotNbr, CSDRspot rSpot, java.lang.String fSpotName)
          add() - add entry to the Rmap
 void clear()
          clear() - clear Rmap
 boolean create(int nRmapSize)
          create() - create the empty Rmap lists and hash tables of size nRmapSize
static java.lang.String getTabDelimitedFields()
          getTabDelimitedFields() - get a string representation of the tab-delimited data fields
 java.lang.String getTabDelimitedFieldsAndData()
          getTabDelimitedFieldsAndData() - get a string representation of this instance as tab-delimited data fields and values.
 void init(int maxRmapSize)
          init() - initialize Rmap list to specified size if > 0.
 boolean regrow(int newRmapSize)
          regrow() - regrow the Rmap
 boolean remove(CSDRspot rSpot)
          remove() - remove entry to the Rmap [TODO]
 boolean remove(java.lang.String fSpotName)
          remove() - remove entry to the Rmap
 boolean rightSize()
          rightSize() - right-size the size of the Rmap list to the size actually used.
 java.lang.String toString()
          toString() - get a pretty-print string representation of this instance
 java.lang.String toTabDelimitedData()
          toTabDelimitedData() - get a string representation of this instance as tab-delimited data values
 java.lang.String toXML()
          toXML() - get a string representation of this instance as XML
 
Methods inherited from class O2Plib.db.CSD.CSDglb
initGlb
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Version for this module

See Also:
Constant Field Values

glbIdRmapCounter

public static int glbIdRmapCounter
Global Rmap ID counter


name

public java.lang.String name
Name of the condition


timeStamp

public java.lang.String timeStamp

title

public java.lang.String title
title information of condition.


idRmap

public int idRmap
Rmap id for this instance


mapRspotToStdSpotFlag

public boolean mapRspotToStdSpotFlag
false is standard Rspot mapping, true is standard Foreign Fspot mapping


nRmapSize

public int nRmapSize
The # of spots in the map


maxRmapSize

public int maxRmapSize
The maximum # of spots in the preallocated map lists


rspotNbr2Rspot

public CSDRspot[] rspotNbr2Rspot
[0:nRmapSize-1] map of a number Rspot id number to the Rspot set object.


rSampleSpotNbr2RspotNbr

public int[] rSampleSpotNbr2RspotNbr
[0:nRmapSize-1] map of Rsample spot number to the Rspot set idNbr.


foreignSpotName2RpotNbrHT

public java.util.Hashtable foreignSpotName2RpotNbrHT
map of foreign spot name to Rspot set #


foreignSpotName

public java.lang.String[] foreignSpotName
[0:nRmapSize-1] list of foreign spot names mapped by rspotNbr


rspotNbr2Annotation

public CSDannotation[] rspotNbr2Annotation
[0:nRmapSize-1] list of Rspot annotation objects if any. This lets us save arbitrary annotation determined at run time by Rspot number

Constructor Detail

CSDRmap

public CSDRmap()
CSDRmap() - Constructor for new CSDRmap.


CSDRmap

public CSDRmap(java.lang.String name,
               java.lang.String timeStamp,
               java.lang.String title)
CSDRmap() - Constructor for new CSDRmap.

Parameters:
name - of the Rmap
timeStamp - when the Rmap
title - information of Rmap
Method Detail

clear

public void clear()
clear() - clear Rmap

Specified by:
clear in interface CSDlistInterface

init

public void init(int maxRmapSize)
init() - initialize Rmap list to specified size if > 0.

Specified by:
init in interface CSDlistInterface
Parameters:
size - to initialize size of the maximum list

rightSize

public boolean rightSize()
rightSize() - right-size the size of the Rmap list to the size actually used. [TODO]

Specified by:
rightSize in interface CSDlistInterface
Returns:
true if succeed

create

public boolean create(int nRmapSize)
create() - create the empty Rmap lists and hash tables of size nRmapSize

Parameters:
nRmapSize - is # of Rspot sets in database
Returns:
true if succeed

regrow

public boolean regrow(int newRmapSize)
regrow() - regrow the Rmap

Specified by:
regrow in interface CSDlistInterface
Parameters:
newRmapSize - is new # of Rspot sets in database
Returns:
true if succeed or don't need to regrow the list.

add

public boolean add(int rspotNbr,
                   CSDRspot rSpot,
                   java.lang.String fSpotName)
add() - add entry to the Rmap

Parameters:
nRmapSize - is # of Rspot sets in database
rSpot - is Rspot to add
fSpotName - is foreign name of the rSpot
Returns:
true if succeed

remove

public boolean remove(CSDRspot rSpot)
remove() - remove entry to the Rmap [TODO]

Parameters:
rSpot - is Rspot to remove
Returns:
true if succeed

remove

public boolean remove(java.lang.String fSpotName)
remove() - remove entry to the Rmap

Parameters:
fSpotName - is foreign name of the rSpot to remove
Returns:
true if succeed

toString

public java.lang.String toString()
toString() - get a pretty-print string representation of this instance

Specified by:
toString in interface CSDlistInterface
Overrides:
toString in class java.lang.Object
Returns:
string representation of this instance

getTabDelimitedFieldsAndData

public java.lang.String getTabDelimitedFieldsAndData()
getTabDelimitedFieldsAndData() - get a string representation of this instance as tab-delimited data fields and values. Data is repeated on each line as horizontally stacked data - suitable for reading into R.

Returns:
string representation of this full instance

getTabDelimitedFields

public static java.lang.String getTabDelimitedFields()
getTabDelimitedFields() - get a string representation of the tab-delimited data fields

Returns:
string representation of this instance

toTabDelimitedData

public java.lang.String toTabDelimitedData()
toTabDelimitedData() - get a string representation of this instance as tab-delimited data values

Returns:
string representation of this instance

toXML

public java.lang.String toXML()
toXML() - get a string representation of this instance as XML

Returns:
string representation of this instance