|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.rubecula.darwin.domain.environment.TraitFactory
public final class TraitFactory
Factory Class to create Trait objects. Applications can't change this class (it is final) but they can override the methods which call these methods.
Method Summary | |
---|---|
static Trait |
makeDiscrete(Pharacter character,
java.lang.String variant)
Factory method to create a discrete trait -- that is where the value is one of a finite set of variants, as opposed to the variable trait as in the case of makeVariable(Pharacter, double) . |
static Trait |
makeTrait(java.lang.Class<? extends Trait> clazz,
java.lang.Character character,
java.lang.Object value)
TEST |
static Trait |
makeVariable(Pharacter character,
double value)
Factory method to create a variable trait -- that is where the value is infinitely (or relatively infinitely) variable (as opposed to one of a discrete set) as in the case of makeDiscrete(Pharacter, String) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Trait makeDiscrete(Pharacter character, java.lang.String variant)
makeVariable(Pharacter, double)
.
character
- the phenotypic character of which this is a variant.variant
- the key to the variant.
public static Trait makeTrait(java.lang.Class<? extends Trait> clazz, java.lang.Character character, java.lang.Object value)
clazz
- the class of Trait to instantiate, which must have a
constructor of form Trait(Character,Object).character
- the phenotypic character to which this trait refers.value
- the value.
public static Trait makeVariable(Pharacter character, double value)
makeDiscrete(Pharacter, String)
.
XXX check why there are two calls to this method. It seems to me there
should be only one.
character
- the phenotypic character of which this is an instance.value
- the value of the trait
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |