com.rubecula.darwin.domain.environment
Class PhenotypeFactory

java.lang.Object
  extended by com.rubecula.darwin.domain.environment.PhenotypeFactory

public final class PhenotypeFactory
extends java.lang.Object

Factory Class to create Phenotype objects. Applications can't change this class (it is final) but they can override the methods which call these methods. TODO fix up the other factory classes so that it works like this one. TODO figure out a way to reference Phenotype_Dawkinsian directly without violating any architectural issues.

Author:
Robin Hillyard

Method Summary
static int getNextSequence()
          Deprecated. 
static Phenotype makeDawkinsian()
           
static Phenotype makePhenotype(java.lang.Class<? extends Phenotype> clazz, java.lang.Class<? extends java.lang.Object>[] parameterClasses, java.lang.Object[] parameterValues)
           
static Phenotype makePhenotype(java.lang.String classname, java.lang.Class<? extends java.lang.Object>[] parameterClasses, java.lang.Object[] parameterValues)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNextSequence

@Deprecated
public static int getNextSequence()
Deprecated. 

This is only for the use of unit tests. TODO by using pattern matching, avoid having to use this.

Returns:
the sequence

makeDawkinsian

public static Phenotype makeDawkinsian()
Returns:
a newly created Phenotype_Dawkinsian object.

makePhenotype

public static Phenotype makePhenotype(java.lang.Class<? extends Phenotype> clazz,
                                      java.lang.Class<? extends java.lang.Object>[] parameterClasses,
                                      java.lang.Object[] parameterValues)
Parameters:
clazz - the class of Phenotype to instantiate, which must have a constructor of form Phenotype(EcoFactor,Object).
parameterClasses - XXX
parameterValues - XXX
Returns:
a newly constructed Phenotype.

makePhenotype

public static Phenotype makePhenotype(java.lang.String classname,
                                      java.lang.Class<? extends java.lang.Object>[] parameterClasses,
                                      java.lang.Object[] parameterValues)
Parameters:
classname - the fully qualified name of the Phenotype class requied.
parameterClasses - XXX
parameterValues - the parameters for the constructor
Returns:
a newly constructed Phenotype.


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