com.rubecula.darwin.domain.environment
Class Phenotype_
java.lang.Object
net.sf.tostring0.AToString
com.rubecula.darwin.domain.environment.TraitMap_
com.rubecula.darwin.domain.environment.Phenotype_
- All Implemented Interfaces:
- CacheSignature, Censusible, Fit, Phenotype, TraitMap, net.sf.tostring0.Identifiable, net.sf.tostring0.IToString
- Direct Known Subclasses:
- Phenotype_Dawkinsian, Phenotype_TS
public abstract class Phenotype_
- extends TraitMap_
- implements Phenotype
Abstract class to define the base methods and fields for an implementation of
Phenotype
.
- Author:
- Robin Hillyard
Field Summary |
java.util.List<ExPhen> |
_extendedPhenotypes
the list of extended phenotypes for this phenotype. |
protected static org.apache.commons.logging.Log |
LOG
The logger for this class. |
Fields inherited from interface net.sf.tostring0.IToString |
ANGBR_OPEN, ANGBRA_CLSE, BRA_CLSE, BRA_OPEN, BRCE_OPEN, BRCS_CLSE, COLON, LIST_SEPARATOR, MAX_ELEMENTS_DEFAULT, S_MT, S_PERCENT, SEPARATOR, SPACE |
Constructor Summary |
protected |
Phenotype_(java.lang.String id)
Constructor to create an identified empty Phenotype. |
Methods inherited from class net.sf.tostring0.AToString |
toString, toString, toStringBrief, toStringId |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.tostring0.IToString |
toString, toStringBrief, toStringId |
_extendedPhenotypes
public final java.util.List<ExPhen> _extendedPhenotypes
- the list of extended phenotypes for this phenotype.
LOG
protected static final org.apache.commons.logging.Log LOG
- The logger for this class.
Phenotype_
protected Phenotype_(java.lang.String id)
- Constructor to create an identified empty Phenotype.
- Parameters:
id
- the identifier for this Phenotype
addExtended
public void addExtended(ExPhen expression)
- Specified by:
addExtended
in interface Phenotype
- See Also:
Phenotype.addExtended(com.rubecula.darwin.domain.helper.ExPhen)
addTrait
public java.lang.String addTrait(java.lang.String key,
Trait trait)
- Add a trait and set it to "belong" to this
Phenotype
.
- Specified by:
addTrait
in interface Phenotype
- Parameters:
key
- trait
-
- Returns:
- the key to the new trait (so it can be found in the trait map).
- See Also:
Phenotype.addTrait(java.lang.String,
com.rubecula.darwin.domain.helper.Trait)
addTrait
public java.lang.String addTrait(Trait trait)
- Add a trait using for its key the id of the character to which this trait
belongs.
- Specified by:
addTrait
in interface Phenotype
- Parameters:
trait
- the trait.
- Returns:
- the key that this trait is indexed under.
- See Also:
Phenotype.addTrait(com.rubecula.darwin.domain.helper.Trait)
doCensus
public void doCensus(Pharacter character,
FrequencyMap<Trait> traitFrequencies)
- Specified by:
doCensus
in interface Phenotype
- Parameters:
character
- traitFrequencies
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class TraitMap_
- See Also:
TraitMap_.equals(java.lang.Object)
getExtendedPhenotypes
public java.util.Collection<ExPhen> getExtendedPhenotypes()
- Specified by:
getExtendedPhenotypes
in interface Phenotype
- Returns:
- a collection of extended phenotype,
ExPhen
, objects. - See Also:
Phenotype.getExtendedPhenotypes()
getIdentifier
public java.lang.String getIdentifier()
- Specified by:
getIdentifier
in interface net.sf.tostring0.Identifiable
- Overrides:
getIdentifier
in class TraitMap_
- Returns:
_id
.- See Also:
TraitMap_.getIdentifier()
getSexTraits
public TraitMap getSexTraits()
- Specified by:
getSexTraits
in interface Phenotype
- Returns:
- the sex-linked traits as a TraitMap
- See Also:
Phenotype.getSexTraits()
hashCode
public int hashCode()
- Overrides:
hashCode
in class TraitMap_
- See Also:
TraitMap_.hashCode()
Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.