gov.nih.nci.caarray.domain.project
Class AbstractExperimentDesignNode

java.lang.Object
  extended by gov.nih.nci.caarray.domain.AbstractCaArrayObject
      extended by gov.nih.nci.caarray.domain.AbstractCaArrayEntity
          extended by gov.nih.nci.caarray.domain.project.AbstractExperimentDesignNode
All Implemented Interfaces:
com.fiveamsolutions.nci.commons.data.persistent.PersistentObject, ProtocolApplicable, java.io.Serializable
Direct Known Subclasses:
AbstractBioMaterial, Hybridization

public abstract class AbstractExperimentDesignNode
extends AbstractCaArrayEntity
implements ProtocolApplicable

Common interface for the nodes in the experiment design graph. The nodes include biomaterials, hybridizations.

Author:
dkokotov
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayEntity
CAARRAY_LSID_AUTHORITY, CAARRAY_LSID_NAMESPACE
 
Fields inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayObject
DEFAULT_BATCH_SIZE, DEFAULT_STRING_COLUMN_SIZE, LARGE_TEXT_FIELD_LENGTH
 
Constructor Summary
AbstractExperimentDesignNode()
           
 
Method Summary
 void addDirectPredecessor(AbstractExperimentDesignNode predecessor)
          Add a new node as a direct predecessor of this node.
 void addDirectSuccessor(AbstractExperimentDesignNode successor)
          Add a new node as a direct successor of this node.
protected abstract  void doAddDirectPredecessor(AbstractExperimentDesignNode predecessor)
          Actually add the new node as a direct predecessor of this node.
protected abstract  void doAddDirectSuccessor(AbstractExperimentDesignNode successor)
          Actually add the new node as a direct successor of this node.
abstract  java.util.Set<CaArrayFile> getAllDataFiles()
           
 java.util.Set<AbstractCharacteristic> getCharacteristics(Category category)
          Return the characteristics with given category that are directly present on this ExperimentDesignNode.
 java.util.Set<AbstractCharacteristic> getCharacteristicsRecursively(Category category)
          Return the characteristics with given category that are present in the chain terminating at this node.
abstract  java.util.Set<? extends AbstractExperimentDesignNode> getDirectPredecessors()
           
abstract  java.util.Set<? extends AbstractExperimentDesignNode> getDirectSuccessors()
           
abstract  Experiment getExperiment()
          Get the experiment to which this node belongs.
abstract  java.lang.String getName()
           
abstract  ExperimentDesignNodeType getNodeType()
           
 java.util.Set<? extends AbstractExperimentDesignNode> getPredecessorsOfType(ExperimentDesignNodeType type)
           
 java.util.Set<? extends AbstractExperimentDesignNode> getSuccessorsOfType(ExperimentDesignNodeType type)
           
 void merge(AbstractExperimentDesignNode node)
          Merges another AbstractExperimentDesignNode into this one.
 void propagateLastModifiedDataTime(java.util.Date lastModifiedDataTime)
          Propagates the last modified data time up the chain.
 
Methods inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayEntity
getLsid, getLsidAuthority, getLsidNamespace, getLsidObjectId, setLsid, setLsid, setLsidForEntity
 
Methods inherited from class gov.nih.nci.caarray.domain.AbstractCaArrayObject
equals, getCaBigId, getId, getPostLoadSecurityPolicies, getRemoteApiSecurityPolicies, hashCode, setCaBigId, setId, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nih.nci.caarray.domain.protocol.ProtocolApplicable
addProtocolApplication, clearProtocolApplications, getProtocolApplications
 

Constructor Detail

AbstractExperimentDesignNode

public AbstractExperimentDesignNode()
Method Detail

getName

public abstract java.lang.String getName()
Returns:
the name of this node

merge

public void merge(AbstractExperimentDesignNode node)
Merges another AbstractExperimentDesignNode into this one. For simple properties, the other node's value will only be used if the corresponding value in this is null. For unordered Collections, the collections will be merged. For ordered Lists, the specific behavior will be determined by the subclass. The behavior for other types of properties is dependent on subclasses but should be consistent with the behavior of simple properties.

Most of the information will actually be moved from node to this in preparation for deleting node.

Parameters:
node - node to merge into this

getExperiment

public abstract Experiment getExperiment()
Get the experiment to which this node belongs.

Returns:
the experiment to which this node belongs

getNodeType

public abstract ExperimentDesignNodeType getNodeType()
Returns:
the type of this node

getDirectSuccessors

public abstract java.util.Set<? extends AbstractExperimentDesignNode> getDirectSuccessors()
Returns:
the set of all nodes that are immediately to the right of this node in the experment design or hybridization channel

getDirectPredecessors

public abstract java.util.Set<? extends AbstractExperimentDesignNode> getDirectPredecessors()
Returns:
the set of all nodes that are immediately to the left of this node in the experment design or hybridization channel

getSuccessorsOfType

public java.util.Set<? extends AbstractExperimentDesignNode> getSuccessorsOfType(ExperimentDesignNodeType type)
Parameters:
type - type of nodes to return
Returns:
the set of all nodes that are to the right of this node in the experment design or hybridization channel and are of the given type. This is taking the transitive closure of getDirectSuccessors() and filtering out all nodes not of the given type.

getPredecessorsOfType

public java.util.Set<? extends AbstractExperimentDesignNode> getPredecessorsOfType(ExperimentDesignNodeType type)
Parameters:
type - type of nodes to return
Returns:
the set of all nodes that are to the left of this node in the experment design or hybridization channel and are of the given type. This is taking the transitive closure of getDirectPredecessors() and filtering out all nodes not of the given type.

addDirectSuccessor

public void addDirectSuccessor(AbstractExperimentDesignNode successor)
Add a new node as a direct successor of this node. This method ensures the node is of the correct type; subclasses should implement doAddDirectSuccessor to actually perform the addition.

Parameters:
successor - the new node

doAddDirectSuccessor

protected abstract void doAddDirectSuccessor(AbstractExperimentDesignNode successor)
Actually add the new node as a direct successor of this node. subclasses must implement this method to actually perform the addition.

Parameters:
successor - the new node. it is assumed this node is of the correct type

addDirectPredecessor

public void addDirectPredecessor(AbstractExperimentDesignNode predecessor)
Add a new node as a direct predecessor of this node. This method ensures the node is of the correct type; subclasses should implement doAddDirectPredecessor to actually perform the addition.

Parameters:
predecessor - the new node

doAddDirectPredecessor

protected abstract void doAddDirectPredecessor(AbstractExperimentDesignNode predecessor)
Actually add the new node as a direct predecessor of this node. subclasses must implement this method to actually perform the addition.

Parameters:
predecessor - the new node. it is assumed this node is of the correct type

getCharacteristicsRecursively

public java.util.Set<AbstractCharacteristic> getCharacteristicsRecursively(Category category)
Return the characteristics with given category that are present in the chain terminating at this node. The set of returned characteristics is determined as follows:

Parameters:
category - the category of characteristics to find
Returns:
the characteristics with given category that are present in the chain terminating at this node, as described above.

getCharacteristics

public java.util.Set<AbstractCharacteristic> getCharacteristics(Category category)
Return the characteristics with given category that are directly present on this ExperimentDesignNode.

Parameters:
category - category
Returns:
the characteristics with given category that are directly present on this.

getAllDataFiles

public abstract java.util.Set<CaArrayFile> getAllDataFiles()
Returns:
all the data files related to this node.

propagateLastModifiedDataTime

public void propagateLastModifiedDataTime(java.util.Date lastModifiedDataTime)
Propagates the last modified data time up the chain.

Parameters:
lastModifiedDataTime - the lastDataModificationDate to set.