com.rubecula.darwin.core
Class Factory_Default

java.lang.Object
  extended by com.rubecula.darwin.core.Factory_Abstract
      extended by com.rubecula.darwin.core.Factory_Default
All Implemented Interfaces:
Factory
Direct Known Subclasses:
Factory_PepperedMoth, Factory_TS

public class Factory_Default
extends Factory_Abstract

Default implementation of Factory. For the convenience of applications, this class can be extended. TODO Consider making this class final (because it's a Default class). However, currently it has extenders.

Author:
Robin

Field Summary
protected static String CLASS
           
protected static String NEED_PROPS
           
protected static String NO_PROPS
           
 
Fields inherited from class com.rubecula.darwin.core.Factory_Abstract
P_ALLELE0, P_ALLELE1, P_SEX
 
Constructor Summary
Factory_Default()
           
 
Method Summary
 Allele makeAllele(Object value, Map<String,Object> properties)
          Factory method to instantiate a new Allele of the appropriate class, with an auto-generated key.
 Allele makeAllele(Object key, Object value, Map<String,Object> properties)
          Factory method to instantiate a new Allele of the appropriate class.
 Gene makeGene(int ode, Map<String,Object> properties)
          Factory method to instantiate a new Gene of the appropriate class.
 Genotype makeGenotype(int ode, Map<String,Object> properties)
          Factory method to instantiate a new genotype of the appropriate class.
 Organism makeOrganism(String identifier, Population population, Genotype genotype, Map<String,Object> properties)
          Factory method to instantiate a new organism of the appropriate class.
 Phenotype makePhenotype(Map<String,Object> properties)
          Factory method to instantiate a new phenotype of the appropriate class.
 Trait makeTrait(String identifier, Object value, Map<String,Object> properties)
          Factory method to instantiate a new Trait of the appropriate class.
 
Methods inherited from class com.rubecula.darwin.core.Factory_Abstract
makeAllele, makeAllele, makeDiploidAlleleMap, makeGene, makeGenotype, makeHaploidAlleleMap, makeOrganism, makeOrganism, makeOrganism, makePhenotype, makeSexMap, makeTrait, makeTrait, makeTrait
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_PROPS

protected static final String NO_PROPS
See Also:
Constant Field Values

NEED_PROPS

protected static final String NEED_PROPS
See Also:
Constant Field Values

CLASS

protected static final String CLASS
See Also:
Constant Field Values
Constructor Detail

Factory_Default

public Factory_Default()
Method Detail

makeAllele

public Allele makeAllele(Object value,
                         Map<String,Object> properties)
Description copied from interface: Factory
Factory method to instantiate a new Allele of the appropriate class, with an auto-generated key.

Parameters:
value - the value of the new allele.
properties - a map which specifies any additional properties required at instantation time.
Returns:
a newly constructed instance of Allele.

makeAllele

public Allele makeAllele(Object key,
                         Object value,
                         Map<String,Object> properties)
Description copied from interface: Factory
Factory method to instantiate a new Allele of the appropriate class.

Parameters:
key - the key of the new allele.
value - the value of the new allele.
properties - a map which specifies any additional properties required at instantation time.
Returns:
a newly constructed instance of Allele.

makeGene

public Gene makeGene(int ode,
                     Map<String,Object> properties)
Description copied from interface: Factory
Factory method to instantiate a new Gene of the appropriate class.

Parameters:
ode - the number of alleles to be found at a particular locus (1 if haploid, 2 if diploid).
properties - a map which specifies any additional properties required at instantation time.
Returns:
a newly constructed instance of Gene.

makeGenotype

public Genotype makeGenotype(int ode,
                             Map<String,Object> properties)
Description copied from interface: Factory
Factory method to instantiate a new genotype of the appropriate class.

Parameters:
ode - the number of alleles to be found at a particular locus (1 if haploid, 2 if diploid).
properties - a map which specifies any additional properties required at instantation time.
Returns:
a newly constructed instance of Genotype.

makeOrganism

public Organism makeOrganism(String identifier,
                             Population population,
                             Genotype genotype,
                             Map<String,Object> properties)
Description copied from interface: Factory
Factory method to instantiate a new organism of the appropriate class.

Parameters:
identifier - the identifier for the new organism.
population - the population into which the new organism will be "born".
genotype - the genotype which defines the new organism.
properties - a map which specifies any additional properties required at instantation time.
Returns:
a newly constructed instance of Organism.

makePhenotype

public Phenotype makePhenotype(Map<String,Object> properties)
Description copied from interface: Factory
Factory method to instantiate a new phenotype of the appropriate class.

Parameters:
properties - a map which specifies any additional properties required at instantation time.
Returns:
a newly constructed instance of Phenotype.

makeTrait

public Trait makeTrait(String identifier,
                       Object value,
                       Map<String,Object> properties)
Description copied from interface: Factory
Factory method to instantiate a new Trait of the appropriate class.

Parameters:
identifier - the identifier of the new trait.
value - the initial value of the new trait.
properties - a map which specifies any additional properties required at instantation time.
Returns:
a newly constructed instance of Trait.