com.rubecula.darwin.domain.environment
Class Expresser_

java.lang.Object
  extended by com.rubecula.darwin.domain.environment.Expresser_
All Implemented Interfaces:
Expresser
Direct Known Subclasses:
Expresser_Direct, Expresser_Function, Expresser_Mendelian, Expresser_TS

public abstract class Expresser_
extends java.lang.Object
implements Expresser

Base (abstract) implementation of Expresser. There is no specific support for Epistasis since the expression of each of the various loci is essentially independent. For further information, see Chromosome_.

Author:
Robin Hillyard

Field Summary
protected  Pharacter _character
           
protected static org.apache.commons.logging.Log LOG
          The logger for this class.
 
Constructor Summary
protected Expresser_(Pharacter character)
          protected constructor
 
Method Summary
protected  Trait createTrait(double value)
          TEST
protected static Trait createTrait(Pharacter character, double value)
          TEST
protected static Trait createTrait(Pharacter character, java.lang.String variant)
           
protected  Trait createTrait(java.lang.String key)
           
 boolean equals(java.lang.Object obj)
           
 java.util.Collection<Expression> express(Colony colony, Gene... genes)
          Default implementation of express simply ignores population and returns a collection of one Trait derived from invoking Expresser.express(Gene...).
 Pharacter getCharacter()
           
 java.lang.String getComplement(Locus locus, java.lang.String allele)
          This implementation of getComplement first checks to make sure that the locus is binary (i.e.
 int hashCode()
           
 boolean isComplementary(Locus locus, java.lang.String allele1, java.lang.String allele2)
          XXX Be careful -- this needs to be overridden for any meaningful result.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.rubecula.darwin.domain.helper.Expresser
express
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
The logger for this class.


_character

protected final Pharacter _character
Constructor Detail

Expresser_

protected Expresser_(Pharacter character)
protected constructor

Parameters:
character - the phenotypic character of any resulting traits.
Method Detail

createTrait

protected static Trait createTrait(Pharacter character,
                                   double value)
TEST

Parameters:
character - the phenotypic character.
value - the value of the variable trait (in this case there are no variants for this character.
Returns:
a variable trait for the given character and value.

createTrait

protected static Trait createTrait(Pharacter character,
                                   java.lang.String variant)
Parameters:
character - the phenotypic character.
variant - the key of the desired variant, in the context of the character.
Returns:
a discrete trait for the given character and variant.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

express

public java.util.Collection<Expression> express(Colony colony,
                                                Gene... genes)
Default implementation of express simply ignores population and returns a collection of one Trait derived from invoking Expresser.express(Gene...).

Specified by:
express in interface Expresser
Parameters:
colony - (which may be null)
genes - one gene or a set of polygenic genes.
Returns:
a collection of objects which are either a Trait or an ExPhen
See Also:
Expresser.express(Colony, com.rubecula.darwin.domain.helper.Gene[])

getCharacter

public Pharacter getCharacter()
Specified by:
getCharacter in interface Expresser
Returns:
the character which the expressed trait will exhibit.
See Also:
Expresser.getCharacter()

getComplement

public java.lang.String getComplement(Locus locus,
                                      java.lang.String allele)
This implementation of getComplement first checks to make sure that the locus is binary (i.e. has two alleles) and then simply returns the key for the other allele. If the locus is not binary, then this method will need to be overridden, otherwise an exception will be thrown.

Specified by:
getComplement in interface Expresser
Returns:
the complementary allele key.
See Also:
Expresser.getComplement(com.rubecula.darwin.domain.helper.Locus, java.lang.String)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

isComplementary

public boolean isComplementary(Locus locus,
                               java.lang.String allele1,
                               java.lang.String allele2)
XXX Be careful -- this needs to be overridden for any meaningful result.

Specified by:
isComplementary in interface Expresser
Returns:
true if the alleles are complementary, i.e. if expressed sequentially, the result would be the same as if they had not been expressed at all.
See Also:
Expresser.isComplementary(com.rubecula.darwin.domain.helper.Locus, java.lang.String, java.lang.String)

createTrait

protected Trait createTrait(double value)
TEST

Parameters:
value - the key of the desired variant, in the context of the character.
Returns:
a trait for this expresser's phenotypic character and the designated value.

createTrait

protected Trait createTrait(java.lang.String key)
Parameters:
key - the key of the desired variant, in the context of the character.
Returns:
a trait for this expresser's phenotypic character and the designated variant.


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.