gov.usda.gdpc
Class Phenotype

java.lang.Object
  extended bygov.usda.gdpc.AbstractDBElement
      extended bygov.usda.gdpc.Phenotype
All Implemented Interfaces:
java.lang.Comparable, DBElement, java.util.Map

public class Phenotype
extends AbstractDBElement

This is a database element representing a phenotype.

Author:
terryc

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
static java.lang.String TYPE
           
 
Fields inherited from class gov.usda.gdpc.AbstractDBElement
myProperties
 
Method Summary
static java.lang.String buildKey(java.util.Map properties)
          This builds the unique key for this phenotype based on the PhenotypeProperty.DATA_SOURCE, PhenotypeProperty.TAXON, PhenotypeProperty.ENVIRONMENT_EXPERIMENT, and PhenotypeProperty.ONTOLOGY.
static java.lang.String buildKey(java.lang.String dataSource, Taxon taxon, EnvironmentExperiment experiment, PhenotypeOntology ontology)
          This builds the unique key for this phenotype based on the PhenotypeProperty.DATA_SOURCE, PhenotypeProperty.TAXON, PhenotypeProperty.ENVIRONMENT_EXPERIMENT, and PhenotypeProperty.ONTOLOGY.
static Phenotype getCachedInstance(java.util.Map properties)
          This returns the phenotype instance given specified id and source.
 java.lang.String getDataSource()
          Returns the data source of this phenotype.
 EnvironmentExperiment getEnvironmentExperiment()
          Returns the environment experiment associated with this phenotype.
static Phenotype getInstance(java.util.Map properties)
          This returns the phenotype instance given the specified list of properties.
 java.lang.String getName()
          Returns the name of this phenotype.
 PhenotypeOntology getOntology()
          Returns the ontology of this phenotype.
 Taxon getTaxon()
          Returns the taxon associated with this phenotype.
 java.lang.String getType()
          Get type of this element.
 java.lang.String getValue()
          Returns the value of this phenotype.
 
Methods inherited from class gov.usda.gdpc.AbstractDBElement
clear, compareTo, containsKey, containsValue, entrySet, equals, get, getID, getKey, getProperty, isEmpty, keySet, numProperties, properties, propsEqual, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
hashCode
 

Field Detail

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values
Method Detail

getInstance

public static Phenotype getInstance(java.util.Map properties)
This returns the phenotype instance given the specified list of properties. A new phenotype will be created if its not found in the cache.

Parameters:
properties - properties of this phenotype. The keys are the properties (type: PhenotypeProperty) and the values are the corresponding value. Properties can not have a value equal to null. It is not allowed to have two keys that are the same. The PhenotypeProperty.DATA_SOURCE, PhenotypeProperty.ONTOLOGY, PhenotypeProperty.TAXON, PhenotypeProperty.ENVIRONMENT_EXPERIMENT, and PhenotypeProperty.VALUE properties must be defined.
Returns:
phenotype

getCachedInstance

public static Phenotype getCachedInstance(java.util.Map properties)
This returns the phenotype instance given specified id and source. Null will be returned if its not found in the cache.

Parameters:
properties - properties of this phenotype. The keys are the properties (type: PhenotypeProperty) and the values are the corresponding value. Properties can not have a value equal to null. Only the PhenotypeProperty.DATA_SOURCE, PhenotypeProperty.ONTOLOGY, PhenotypeProperty.TAXON, and PhenotypeProperty.ENVIRONMENT_EXPERIMENT are used to find a matching phenotype in the cache.
Returns:
cached phenotype or null if not in cache.

getName

public java.lang.String getName()
Returns the name of this phenotype.

Specified by:
getName in interface DBElement
Overrides:
getName in class AbstractDBElement
Returns:
the name

buildKey

public static java.lang.String buildKey(java.util.Map properties)
This builds the unique key for this phenotype based on the PhenotypeProperty.DATA_SOURCE, PhenotypeProperty.TAXON, PhenotypeProperty.ENVIRONMENT_EXPERIMENT, and PhenotypeProperty.ONTOLOGY.

Parameters:
properties - properties map
Returns:
key

buildKey

public static java.lang.String buildKey(java.lang.String dataSource,
                                        Taxon taxon,
                                        EnvironmentExperiment experiment,
                                        PhenotypeOntology ontology)
This builds the unique key for this phenotype based on the PhenotypeProperty.DATA_SOURCE, PhenotypeProperty.TAXON, PhenotypeProperty.ENVIRONMENT_EXPERIMENT, and PhenotypeProperty.ONTOLOGY.

Parameters:
dataSource - data source
taxon - taxon
experiment - environment experiment
ontology - phenotype ontology
Returns:
key

getDataSource

public java.lang.String getDataSource()
Returns the data source of this phenotype.

Specified by:
getDataSource in interface DBElement
Overrides:
getDataSource in class AbstractDBElement
Returns:
data source

getTaxon

public Taxon getTaxon()
Returns the taxon associated with this phenotype.

Returns:
taxon

getEnvironmentExperiment

public EnvironmentExperiment getEnvironmentExperiment()
Returns the environment experiment associated with this phenotype.

Returns:
environment experiment

getOntology

public PhenotypeOntology getOntology()
Returns the ontology of this phenotype.

Returns:
ontology

getValue

public java.lang.String getValue()
Returns the value of this phenotype.

Returns:
value

getType

public java.lang.String getType()
Get type of this element.

Returns:
type