com.rubecula.darwin.domain.genetics
Class GeneFactory

java.lang.Object
  extended by com.rubecula.darwin.domain.genetics.GeneFactory

public final class GeneFactory
extends java.lang.Object

Factory Class to create Gene objects. Applications can't change this class (it is final) but they can override the methods which call these methods.

Author:
Robin Hillyard

Method Summary
static Gene makeDiploid(Locus locus, java.lang.String allele1, java.lang.String allele2)
          Construct a new Gene_Diploid with the given allele indexes
static Gene makeGene(java.lang.Class<? extends Gene> clazz, Locus locus, java.lang.Object... parameters)
          TEST
static Gene makeHaploid(Locus locus, java.lang.String allele)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeDiploid

public static Gene makeDiploid(Locus locus,
                               java.lang.String allele1,
                               java.lang.String allele2)
Construct a new Gene_Diploid with the given allele indexes

Parameters:
locus - the locus for the new gene
allele1 - the key for the 1st allele
allele2 - the key for the 2nd allele
Returns:
a newly created diploid gene

makeGene

public static Gene makeGene(java.lang.Class<? extends Gene> clazz,
                            Locus locus,
                            java.lang.Object... parameters)
TEST

Parameters:
clazz - the class of Gene to instantiate, which must have a constructor of form Gene(Locus,Object[]).
locus - the locus to which the new gene will belong.
parameters - the parameters to pass to the constructor.
Returns:
a newly constructed Gene.

makeHaploid

public static Gene makeHaploid(Locus locus,
                               java.lang.String allele)
Parameters:
locus - the locus for the new gene
allele - the key to the allele
Returns:
a newly constructed haploid gene


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