org.geworkbench.bison.datastructure.biocollections
Class CSDataSet<T extends DSBioObject>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<T>
              extended by org.geworkbench.bison.datastructure.complex.panels.CSItemList<T>
                  extended by org.geworkbench.bison.datastructure.complex.panels.CSSequentialItemList<T>
                      extended by org.geworkbench.bison.datastructure.biocollections.CSDataSet<T>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>, java.util.RandomAccess, DSDataSet<T>, DSItemList<T>, DSDescribable, DSExtendable, DSIdentifiable, DSNamed
Direct Known Subclasses:
CSAncillaryDataSet, CSMicroarraySet, CSSequenceSet

public class CSDataSet<T extends DSBioObject>
extends CSSequentialItemList<T>
implements DSDataSet<T>

An abstract implementation of DSDataSet.

See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList<java.lang.Integer> columnOrder
           
protected  java.lang.String compatibilityLabel
           
protected  java.util.HashMap<java.lang.Class<?>,java.lang.Object> dataSetProperties
           
protected  java.lang.String description
          Used in the implementation of the Describable interface.
protected  java.lang.String experimentInfo
          Stores the experiment information (if any) associated with the microarray set.
protected  CSExtendable extend
          Used in the implementation of the Extendable interface.
protected  java.io.File file
           
protected  java.lang.String label
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
CSDataSet()
          Creates a new data set.
 
Method Summary
 void addNameValuePair(java.lang.String name, java.lang.Object value)
          Adds a new name-value mapping.
 void addObject(java.lang.Class<?> tag, java.lang.Object object)
          Adds an object by tag to this data set.
 void allowMultipleValues(java.lang.String name)
          Conjugate method for forceUniqueValue.
 void clearName(java.lang.String name)
          Removes all values associated with the given name.
 void forceUniqueValue(java.lang.String name)
          Forces that the name be associated with at most one value.
 java.util.ArrayList<java.lang.Integer> getColumnOrder()
           
 java.lang.String getCompatibilityLabel()
          Gets a string describing the compatibility of this data set.
 java.lang.String getDataSetName()
          The name of data set.
 java.lang.String getDescription()
          Get all available descriptions in the form of an array of strings.
 java.lang.String getExperimentInformation()
          Returns the experiment information associated with the microarray set.
 java.io.File getFile()
          The underlying file associated with this data set.
 java.lang.String getID()
          Gets the ID for this object.
 java.lang.String getLabel()
          Gets the label for this data set.
 java.lang.Object getObject(java.lang.Class<?> tag)
          Gets an object by the provided tag.
 java.lang.Object[] getValuesForName(java.lang.String name)
          Returns all values mapped to the designated name.
 boolean isActive()
          Gets the activation status of the data set.
 boolean isUniqueValue(java.lang.String name)
          Check if forceUniqueValue() is in effect for the designated name.
 void setColumnOrder(java.util.ArrayList<java.lang.Integer> columnOrder)
           
 void setDescription(java.lang.String description)
          Append a new description to the list of existing descriptions.
 void setExperimentInformation(java.lang.String experimentInformation)
          Set the experiment information.
 void setFile(java.io.File file)
           
 void setID(java.lang.String id)
          Sets the ID for this object.
 void setLabel(java.lang.String label)
          Sets the label for this data set.
 java.lang.String toString()
          Gets a string representation for this data set.
 void writeToFile(java.lang.String fileName)
          Writes the data set to the provided filename.
 
Methods inherited from class org.geworkbench.bison.datastructure.complex.panels.CSSequentialItemList
add, add, remove
 
Methods inherited from class org.geworkbench.bison.datastructure.complex.panels.CSItemList
addAll, clear, equals, get, hashCode, set, setLabel
 
Methods inherited from class java.util.ArrayList
addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.geworkbench.bison.datastructure.complex.panels.DSItemList
get
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Field Detail

file

protected java.io.File file

label

protected java.lang.String label

compatibilityLabel

protected java.lang.String compatibilityLabel

description

protected java.lang.String description
Used in the implementation of the Describable interface.


extend

protected CSExtendable extend
Used in the implementation of the Extendable interface.


experimentInfo

protected java.lang.String experimentInfo
Stores the experiment information (if any) associated with the microarray set.


dataSetProperties

protected java.util.HashMap<java.lang.Class<?>,java.lang.Object> dataSetProperties

columnOrder

protected java.util.ArrayList<java.lang.Integer> columnOrder
Constructor Detail

CSDataSet

public CSDataSet()
Creates a new data set.

Method Detail

addObject

public void addObject(java.lang.Class<?> tag,
                      java.lang.Object object)
Adds an object by tag to this data set.

Specified by:
addObject in interface DSDataSet<T extends DSBioObject>
Parameters:
tag - the tag for the object.
object -

getLabel

public java.lang.String getLabel()
Gets the label for this data set.

Specified by:
getLabel in interface DSNamed
Returns:
the data set's label.

setLabel

public void setLabel(java.lang.String label)
Sets the label for this data set.

Specified by:
setLabel in interface DSNamed
Parameters:
label - the new label.

toString

public java.lang.String toString()
Gets a string representation for this data set.

Overrides:
toString in class java.util.AbstractCollection<T extends DSBioObject>
Returns:
the same result as getLabel().

getObject

public java.lang.Object getObject(java.lang.Class<?> tag)
Gets an object by the provided tag. If the object is not found and tag is a Class object, then this method attempts to create a new instance of the given Class via a no-arg constructor. It then associates this new object with the tag.

Specified by:
getObject in interface DSDataSet<T extends DSBioObject>
Parameters:
tag - the tag for the object sought.
Returns:
the associated object.

isActive

public boolean isActive()
Gets the activation status of the data set.

Specified by:
isActive in interface DSDataSet<T extends DSBioObject>
Returns:
true if active, true otherwise.

getCompatibilityLabel

public java.lang.String getCompatibilityLabel()
Gets a string describing the compatibility of this data set.

Specified by:
getCompatibilityLabel in interface DSDataSet<T extends DSBioObject>
Returns:
the compatibility label.

getFile

public java.io.File getFile()
The underlying file associated with this data set.

Specified by:
getFile in interface DSDataSet<T extends DSBioObject>
Returns:
the file for this data set.

setFile

public void setFile(java.io.File file)
Specified by:
setFile in interface DSDataSet<T extends DSBioObject>

getDataSetName

public java.lang.String getDataSetName()
The name of data set.

Specified by:
getDataSetName in interface DSDataSet<T extends DSBioObject>
Returns:
the data set name.

getID

public java.lang.String getID()
Description copied from class: CSItemList
Gets the ID for this object.

Specified by:
getID in interface DSIdentifiable
Overrides:
getID in class CSItemList<T extends DSBioObject>
Returns:
the id of this item list.

setID

public void setID(java.lang.String id)
Description copied from class: CSItemList
Sets the ID for this object.

Specified by:
setID in interface DSIdentifiable
Overrides:
setID in class CSItemList<T extends DSBioObject>
Parameters:
id - the new id for this item list.

setDescription

public void setDescription(java.lang.String description)
Append a new description to the list of existing descriptions.

Specified by:
setDescription in interface DSDescribable
Parameters:
description - the new description to be added.

getDescription

public java.lang.String getDescription()
Get all available descriptions in the form of an array of strings.

Specified by:
getDescription in interface DSDescribable
Returns:
an array containing all descriptions.

addNameValuePair

public void addNameValuePair(java.lang.String name,
                             java.lang.Object value)
Adds a new name-value mapping.

Specified by:
addNameValuePair in interface DSExtendable
Parameters:
name -
value -

getValuesForName

public java.lang.Object[] getValuesForName(java.lang.String name)
Returns all values mapped to the designated name.

Specified by:
getValuesForName in interface DSExtendable
Parameters:
name -
Returns:
All values associated with the argument name.

forceUniqueValue

public void forceUniqueValue(java.lang.String name)
Forces that the name be associated with at most one value. Attempting to add a name-value pair for a 'name' that already has an associate value, results in old name-value association be replaced by the new one.

Calling this method for an existing 'name' results in all the associated name-value pairs to be cleared.

Specified by:
forceUniqueValue in interface DSExtendable
Parameters:
name - The 'name' upon which uniqueness of value will be enforced.

allowMultipleValues

public void allowMultipleValues(java.lang.String name)
Conjugate method for forceUniqueValue. Enables a 'name' to accept mulptiple name-value asscociations.

Specified by:
allowMultipleValues in interface DSExtendable
Parameters:
name - The 'name' for which multiplicity of value is enabled.

isUniqueValue

public boolean isUniqueValue(java.lang.String name)
Check if forceUniqueValue() is in effect for the designated name.

Specified by:
isUniqueValue in interface DSExtendable
Parameters:
name -
Returns:

clearName

public void clearName(java.lang.String name)
Removes all values associated with the given name.

Specified by:
clearName in interface DSExtendable
Parameters:
name -

getExperimentInformation

public java.lang.String getExperimentInformation()
Returns the experiment information associated with the microarray set. What constitutes "experiment information" varies, depending on the input source where the microarray set came from. E.g., for Affy input files it is the file preamble (the part just before the data lines which provides various experiment execution parameters) that becomes the experiment information.

Specified by:
getExperimentInformation in interface DSDataSet<T extends DSBioObject>
Returns:

setExperimentInformation

public void setExperimentInformation(java.lang.String experimentInformation)
Set the experiment information.

Specified by:
setExperimentInformation in interface DSDataSet<T extends DSBioObject>
Parameters:
experimentInformation -

writeToFile

public void writeToFile(java.lang.String fileName)
Description copied from interface: DSDataSet
Writes the data set to the provided filename.

Specified by:
writeToFile in interface DSDataSet<T extends DSBioObject>
Parameters:
fileName - the filename (path) to which to write this file.

getColumnOrder

public java.util.ArrayList<java.lang.Integer> getColumnOrder()
Specified by:
getColumnOrder in interface DSDataSet<T extends DSBioObject>

setColumnOrder

public void setColumnOrder(java.util.ArrayList<java.lang.Integer> columnOrder)
Specified by:
setColumnOrder in interface DSDataSet<T extends DSBioObject>