O2Plib.db.CSD
Class CSDcond

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

public class CSDcond
extends CSDglb
implements CSDlistInterface

Class CSDcond contains a list of Samples for a condition set of samples for the Composite Samples Database (CSD).


 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.11 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702

Field Summary
static int glbIdCondCounter
          Global Condition list ID counter
 int idCond
          Condition list id for this instance
 int maxSamples
          maximum # of samples in allocated condition list.
 java.lang.String name
          Name of the condition
 int nSamples
          # of samples in condition.
 DbSample[] sampleList
          [0:nSamples-1] list of samples in condition.
 java.lang.String[] sampleNames
          [0:nSamples-1] list of names of samples in condition.
 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
CSDcond()
          CSDcond() - Constructor for new CSDcond with a cleared list.
CSDcond(java.lang.String name, java.lang.String timeStamp, java.lang.String title)
          CSDcond() - Constructor for new CSDcond with a cleared list.
 
Method Summary
 boolean add(DbSample dbS)
          add() - add sample to condition.
 boolean add(DbSample dbS, java.lang.String sName)
          add() - add sample to condition.
 boolean add(java.lang.String sName)
          add() - add sample name to condition.
 void clear()
          clear() - clear condition list
 CSDcond cloneIt()
          cloneIt() - make a cloned copy of a condition.
 CSDcond difference(CSDcond r1, CSDcond r2)
          difference() - do the intersection of two condition lists r3= difference(r1,r2).
 java.lang.String[] getSampleNames()
          getSampleNames() - get the list of sample namess
 DbSample[] getSamplesList()
          getSampleList() - get the list of sample DbSample objects
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 size)
          init() - initialize Condition list to specified size if > 0.
 CSDcond intersection(CSDcond r1, CSDcond r2)
          intersection() - do the intersection of two condition lists r3= intersection(r1,r2).
 int lookupIdxBySample(DbSample dbS)
          lookupIdxBySample() - lookup index of sample object in condition.
 int lookupIdxBySample(java.lang.String sName)
          lookupIdxBySample() - lookup index of sample name in condition.
 boolean regrow(int newSize)
          regrow() - grow the condition.
 boolean remove(DbSample dbS)
          remove() - remove sample to condition.
 boolean remove(java.lang.String sName)
          remove() - remove sample to condition.
 boolean rightSize()
          rightSize() - right-size the size of the Condition list to the size actually used.
 void sort()
          sort() - sort the condition set in ascending order by sample names
 java.lang.String toString()
          toString() - print list of DbDsamples in the Condition list.
 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
 CSDcond union(CSDcond r1, CSDcond r2)
          union() - do the union of two condition lists r3= union(r1,r2).
 
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

glbIdCondCounter

public static int glbIdCondCounter
Global Condition list 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.


idCond

public int idCond
Condition list id for this instance


maxSamples

public int maxSamples
maximum # of samples in allocated condition list.


nSamples

public int nSamples
# of samples in condition.


sampleNames

public java.lang.String[] sampleNames
[0:nSamples-1] list of names of samples in condition.


sampleList

public DbSample[] sampleList
[0:nSamples-1] list of samples in condition.

Constructor Detail

CSDcond

public CSDcond()
CSDcond() - Constructor for new CSDcond with a cleared list.


CSDcond

public CSDcond(java.lang.String name,
               java.lang.String timeStamp,
               java.lang.String title)
CSDcond() - Constructor for new CSDcond with a cleared list.

Parameters:
name - of the condition list of Samples
timeStamp - when the condition list of Samples
title - information of condition list of Samples.
Method Detail

clear

public void clear()
clear() - clear condition list

Specified by:
clear in interface CSDlistInterface

init

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

Specified by:
init in interface CSDlistInterface
Parameters:
maxSamples - initialization size

rightSize

public boolean rightSize()
rightSize() - right-size the size of the Condition list to the size actually used.

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

regrow

public boolean regrow(int newSize)
regrow() - grow the condition. If the size is LEQ 0, then clear the list (set it to null).

Specified by:
regrow in interface CSDlistInterface
Parameters:
newSize - of the condition list
Returns:
true if succeed

sort

public void sort()
sort() - sort the condition set in ascending order by sample names


add

public boolean add(DbSample dbS,
                   java.lang.String sName)
add() - add sample to condition.

Parameters:
dbS - is sample object
sName - is sample name
Returns:
true if succeed

add

public boolean add(DbSample dbS)
add() - add sample to condition. Use the sample dbS.baseSampleName for the name

Parameters:
dbS - is sample object
Returns:
true if succeed

add

public boolean add(java.lang.String sName)
add() - add sample name to condition. Do not save the sample name.

Parameters:
sName - is sample name
Returns:
true if succeed

lookupIdxBySample

public int lookupIdxBySample(java.lang.String sName)
lookupIdxBySample() - lookup index of sample name in condition.

Parameters:
sName - is sample name
Returns:
-1 if failed, else the index if succeed

lookupIdxBySample

public int lookupIdxBySample(DbSample dbS)
lookupIdxBySample() - lookup index of sample object in condition.

Parameters:
dbS - is sample object
Returns:
-1 if failed, else the index if succeed

remove

public boolean remove(java.lang.String sName)
remove() - remove sample to condition.

Parameters:
sName - is sample name
Returns:
true if succeed

remove

public boolean remove(DbSample dbS)
remove() - remove sample to condition.

Parameters:
dbS - is sample object
Returns:
true if succeed

cloneIt

public CSDcond cloneIt()
cloneIt() - make a cloned copy of a condition.

Parameters:
dbR - is Rspot object
Returns:
-1 if failed, else the index if succeed

intersection

public CSDcond intersection(CSDcond r1,
                            CSDcond r2)
intersection() - do the intersection of two condition lists r3= intersection(r1,r2). I.e., Samples in r1 must also be in r2 else it is not in r3.

Parameters:
r1 - is condition
r2 - is condition
Returns:
CSDcond r3 of new condition if succeed, else null

union

public CSDcond union(CSDcond r1,
                     CSDcond r2)
union() - do the union of two condition lists r3= union(r1,r2).

Parameters:
r1 - is condition
r2 - is condition
Returns:
CSDcond r3 of new condition if succeed, else null

difference

public CSDcond difference(CSDcond r1,
                          CSDcond r2)
difference() - do the intersection of two condition lists r3= difference(r1,r2). That is (r1 less r2). If a sample in r2 is in r2, then it is removed from r3. If the sample is in r2 but not in r1, it is ignored.

Parameters:
r1 - is condition
r2 - is condition
Returns:
CSDcond r3 of new condition if succeed, else null

getSampleNames

public java.lang.String[] getSampleNames()
getSampleNames() - get the list of sample namess

Returns:
list if succeed else null

getSamplesList

public DbSample[] getSamplesList()
getSampleList() - get the list of sample DbSample objects

Returns:
list if succeed else null

toString

public java.lang.String toString()
toString() - print list of DbDsamples in the Condition list.

Specified by:
toString in interface CSDlistInterface
Overrides:
toString in class java.lang.Object
Returns:
prettyprint condition list string

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