|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.tostring0.AToString
com.rubecula.darwin.domain.genetics.Locus_
public abstract class Locus_
Abstract class defining the base methods and fields for an implementer of
Locus.
| Field Summary | |
|---|---|
protected static org.apache.commons.logging.Log |
LOG
The logger for this class. |
| Fields inherited from interface com.rubecula.darwin.domain.helper.Locus |
|---|
ID_SEX |
| Fields inherited from interface net.sf.tostring0.IToString |
|---|
ANGBR_OPEN, ANGBRA_CLSE, BRA_CLSE, BRA_OPEN, BRCE_OPEN, BRCS_CLSE, COLON, LIST_SEPARATOR, MAX_ELEMENTS_DEFAULT, S_MT, S_PERCENT, SEPARATOR, SPACE |
| Constructor Summary | |
|---|---|
protected |
Locus_(java.lang.String identifier)
Protected method to construct a plain vanilla implementer of Locus. |
| Method Summary | |
|---|---|
java.lang.String |
addAllele(Allele allele)
Incrementally add the given allele to this Locus. |
boolean |
equals(java.lang.Object obj)
|
Allele |
getAllele(java.lang.String key)
|
java.util.Map<java.lang.String,Allele> |
getAlleleMap()
|
java.util.Map<Allele,java.lang.Integer> |
getAlleles()
TODO reduce to default scope. |
java.util.Collection<Allele> |
getAlleleValues()
|
Chromosome |
getChromosome()
|
protected java.util.Map<java.lang.String,java.lang.Integer> |
getFrequencies()
|
java.lang.String |
getIdentifier()
|
java.lang.String |
getKey(Allele allele)
|
Progenitor |
getParent()
|
Locus |
getPolygenic()
|
int |
hashCode()
|
boolean |
isLegal(java.lang.String allele)
Method to determine if the given allele is legal at this Locus. |
boolean |
isSexLinked()
|
Gene |
makeGene(java.lang.String... alleles)
Make a gene with the alleles specified by the variable number of allele indexes. |
protected void |
onChange()
This method is invoked whenever the set of alleles or their frequencies changes |
java.lang.String |
putAllele(Allele allele,
int frequency)
|
void |
setAlleles(java.util.Map<? extends Allele,java.lang.Integer> map)
Preferred method of setting up the allele/frequency map (rather than using add()). |
void |
setParent(Progenitor parent)
Set the parent for this locus. |
void |
setPolygenic(Locus locus)
Bean method to set the next locus in a chain of polygenic loci. |
int |
size()
|
| Methods inherited from class net.sf.tostring0.AToString |
|---|
toString, toString, toStringBrief, toStringId |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.rubecula.darwin.domain.helper.Locus |
|---|
add, pickAllele |
| Methods inherited from interface net.sf.tostring0.IToString |
|---|
toString, toStringBrief, toStringId |
| Field Detail |
|---|
protected static final org.apache.commons.logging.Log LOG
| Constructor Detail |
|---|
protected Locus_(java.lang.String identifier)
Locus.
identifier - the identifier for this locus.| Method Detail |
|---|
public java.lang.String addAllele(Allele allele)
allele to this Locus.
The frequency value for the allele will be 1.
This is an alternative to the preferred method of setting the alleles:
setAlleles(Map).
addAllele in interface Locusallele - an allele which is possible at this locus.
Locus.add(Allele, int) with allele and
1 as the parameters.Locus.addAllele(com.rubecula.darwin.domain.helper.Allele)public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public Allele getAllele(java.lang.String key)
getAllele in interface LocusLocus.getAllele(java.lang.String)public java.util.Map<java.lang.String,Allele> getAlleleMap()
getAlleleMap in interface LocusLocus.getAlleleMap()public java.util.Map<Allele,java.lang.Integer> getAlleles()
_alleleMap and
_frequencies, and so updating the result is just
updating a temporary copy.public java.util.Collection<Allele> getAlleleValues()
getAlleleValues in interface LocusLocus.getAlleleValues()public Chromosome getChromosome()
getChromosome in interface Locusparent.Locus.getChromosome()public java.lang.String getIdentifier()
getIdentifier in interface net.sf.tostring0.IdentifiableIdentifiable.getIdentifier()public java.lang.String getKey(Allele allele)
getKey in interface Locusallele -
List.indexOf(Object) on the #list with
the parameter allele. Will return -1 if the allele is not found.public Progenitor getParent()
getParent in interface LocusChromosome for a non-polygenic locus (or the
first such), otherwise get the polygenic locus which in turn
points to this one.Locus.getParent()public Locus getPolygenic()
getPolygenic in interface LocusLocus.getPolygenic()public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public boolean isLegal(java.lang.String allele)
isLegal in interface Locusallele - the allele to be tested
Locus.isLegal(java.lang.String)public boolean isSexLinked()
isSexLinked in interface SexLinkedSexLinked.isSexLinked()public Gene makeGene(java.lang.String... alleles)
makeGene in interface Locusalleles - variable number of alleles indexes.
Locus.makeGene(java.lang.String[])
public java.lang.String putAllele(Allele allele,
int frequency)
allele - frequency -
public void setAlleles(java.util.Map<? extends Allele,java.lang.Integer> map)
map - public void setParent(Progenitor parent)
setParent in interface Locusparent - either the preceding locus if this locus is polygenic, or the
chromosome that this locus belongs to.Locus.setParent(com.rubecula.darwin.domain.helper.Progenitor)public void setPolygenic(Locus locus)
locus - public int size()
size in interface Locusprotected java.util.Map<java.lang.String,java.lang.Integer> getFrequencies()
protected void onChange()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||