com.rubecula.darwin.core
Class Genome_Abstract
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector
com.rubecula.util.AuditableVector
com.rubecula.darwin.core.Genome_Abstract
- All Implemented Interfaces:
- Genome, Auditable, Identifiable, Serializable, Cloneable, Iterable, Collection, List, RandomAccess
- Direct Known Subclasses:
- Genome_Diploid, Genome_Haploid
public abstract class Genome_Abstract
- extends AuditableVector
- implements Genome
Abstract class implementing base methods for the Genome interface.
- Author:
- Robin Hillyard
TODO define this class using generics so that only Locus objects can be added/retrieved.
- See Also:
- Serialized Form
|
Field Summary |
protected static org.apache.commons.logging.Log |
log
The logger for this class. |
| Methods inherited from class java.util.Vector |
add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
| Methods inherited from interface com.rubecula.darwin.core.Genome |
size |
log
protected static final org.apache.commons.logging.Log log
- The logger for this class.
Genome_Abstract
protected Genome_Abstract(String identifier,
int ode,
Meiosis meioter,
Expression expresser,
Factory factory)
- Constructor for a new Genome_Abstract instance.
This type of Genome undergoes no mutations.
- Parameters:
identifier - the identifier for this Genome.ode - the ode (haploid/diploid/etc).meioter - the implementer of Meiosis.expresser - an implementer of Expression.
which allows any Genotype conforming to this Genome to
be expressed as a Phenotype.factory - the implementer of Factory.
Genome_Abstract
protected Genome_Abstract(String identifier,
int ode,
Meiosis meioter,
Mutator mutator,
Expression expresser,
Factory factory)
- Constructor for a new Genome_Abstract instance.
- Parameters:
identifier - the identifier for this Genome.ode - the ode (haploid/diploid/etc).meioter - the implementer of Meiosis.mutator - the implementer of Mutator which will be applied to all new genotypes.expresser - an implementer of Expression.
which allows any Genotype conforming to this Genome to
be expressed as a Phenotype.factory - the implementer of Factory.
add
public void add(int index,
Locus locus)
- Description copied from interface:
Genome
- Method to
add a Locus at the specified index.
- Specified by:
add in interface Genome
- Parameters:
index - the index at which the new object will appear.locus - a locus to be inserted into this Genome.- See Also:
List.add(int, java.lang.Object)
add
public void add(int arg0,
Object arg1)
- Specified by:
add in interface List- Overrides:
add in class Vector
add
public boolean add(Locus locus)
- Method to
add a Locus at the end of this Genome.
- Specified by:
add in interface Genome
- Parameters:
locus - a locus to be inserted into this Genome.
- Returns:
- true, always.
- See Also:
add(int, Locus)
getExpresser
public Expression getExpresser()
- Description copied from interface:
Genome
- The implementer of
Expression which an application has
specified.
- Specified by:
getExpresser in interface Genome
- Returns:
- the implementer of Expression for this Genome.
getFactory
public Factory getFactory()
- Specified by:
getFactory in interface Genome
- Returns:
- the factory
getLocus
public Locus getLocus(int index)
- Specified by:
getLocus in interface Genome
- Returns:
- the locus defined by
index (0..N)
getMeioter
public Meiosis getMeioter()
- Specified by:
getMeioter in interface Genome
- Returns:
- the application-specified implementer of
Meiosis
getMutator
public Mutator getMutator()
- Specified by:
getMutator in interface Genome
- Returns:
- the mutator
getOde
public int getOde()
- Description copied from interface:
Genome
- Method to return the genetic form for this genome.
- Specified by:
getOde in interface Genome
- Returns:
- the "oidity" which will normally be either
Genome.HAPLOID, i.e. simple or Genome.DIPLOID, i.e. double.