|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.HandlerBase | +--org.concord.biologica.engine.EngineObject | +--org.concord.biologica.engine.OrganismAllele
This class represents an organism allele - an allele within one organism. The key difference between this and a species allele is that a species allele cannot change within a single organism, whereas an organism allele may change (mutate).
An object of this class will generate the following property change events:
EngineProp.BASE_VALUES
,
EngineProp.DELETED
,
EngineProp.ID
,
EngineProp.LOCKED_STATE
,
EngineProp.TEXT_SYMBOL
,
PropertyChangeListener
, Serialized FormFields inherited from class org.concord.biologica.engine.EngineObject |
AUTOMATIC_LOCKED, AUTOMATIC_LOCKED_STRING, changes, deleted, FALSE, id, lockedState, MANUAL_AND_AUTOMATIC_LOCKED, MANUAL_AND_AUTOMATIC_LOCKED_STRING, MANUAL_LOCKED, MANUAL_LOCKED_STRING, NULL_ID, TRUE, UNLOCKED, UNLOCKED_STRING, xmlElementContext |
Constructor Summary | |
OrganismAllele(OrganismChromosome anOrganismChromosome,
OrganismAllele anOrganismAllele)
Create a new organism allele given an organism chromosome and an organism allele to copy. |
|
OrganismAllele(OrganismChromosome anOrganismChromosome,
SpeciesAllele aSpeciesAllele)
Create a new organism allele given an organism chromosome parent and the species allele to use. |
|
OrganismAllele(OrganismChromosome anOrganismChromosome,
java.lang.String anElementName,
int anElementID,
com.sun.xml.parser.Parser anXMLParser,
ImportContext importContext)
Create a new organism allele and start handling XML parsing events to set the properties of this object. |
Method Summary | |
void |
addNucleicAcid(INucleicAcid aNucleicAcid)
Adds a nucleic acid to the holder. |
void |
characters(char[] ch,
int start,
int length)
Receive notification of character data. |
void |
delete()
Delete this object, notifying parent objects and deleting any child objects. |
void |
delete(boolean notifyChange)
|
void |
endElement(java.lang.String anElementName)
Handle notification that the parsing of the given element has ended. |
byte |
getBase(int index)
Returns the base value at the given index in this allele. |
Gene |
getGene()
Returns the allele's gene. |
int |
getLengthInBases()
Returns the length of the allele in bases. |
int |
getLengthInCodons()
Returns the length of the allele in codons. |
Organism |
getOrganism()
Returns the allele's organism. |
OrganismChromosome |
getOrganismChromosome()
Returns the allele's organism chromosome. |
java.lang.String |
getPendingTextSymbol()
Get the text symbol that this allele would have if the changes pending on it were to be applied. |
Species |
getSpecies()
Returns the organism allele's species. |
SpeciesAllele |
getSpeciesAllele()
Returns the organism allele's species allele. |
int |
getStartIndexInHolder()
Returns the start index of this nucleic acid in its holder. |
java.lang.String |
getTextSymbol()
Returns the allele's text symbol. |
World |
getWorld()
Get the world containing this object. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Receive notification of ignorable white space character data. |
boolean |
isMutationAllele()
Is this allele an instance of the mutation allele for its gene? |
void |
reconcileBaseChanges()
Reconcile base changes already made to this organism allele, usually due to a user editing the DNA directly in the DNA View. |
boolean |
removeNucleicAcid(INucleicAcid aNucleicAcid)
Removes a nucleic acid from the holder. |
void |
setBase(int index,
byte newBase)
Sets the base value at the given index in this allele. |
void |
setBases(byte[] newBases)
Sets the base values array for this allele. |
void |
setSpeciesAllele(SpeciesAllele aSpeciesAllele)
Set the organism's species allele. |
void |
setTextSymbol(java.lang.String aTextSymbol)
Set the text symbol of the allele. |
void |
startElement(java.lang.String anElementName,
org.xml.sax.AttributeList amap)
Handle notification that the parser has hit the start of a new element with the given name and attributes. |
java.lang.String |
toString()
Return a string representation of this object, usually the object's name. |
void |
writeToStream(java.io.PrintWriter stream)
Writes this object to the given stream in XML format. |
Methods inherited from class org.concord.biologica.engine.EngineObject |
addPropertyChangeListener, getID, getLockedState, getLockedStateAsString, isAutomaticLocked, isDeleted, isLocked, isManualLocked, notifySelected, release, removePropertyChangeListener, setAutomaticLocked, setID, setLockedState, setLockedStateAsString, setManualLocked |
Methods inherited from class org.xml.sax.HandlerBase |
endDocument, error, fatalError, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, startDocument, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.concord.biologica.engine.INucleicAcidHolder |
getID |
Constructor Detail |
public OrganismAllele(OrganismChromosome anOrganismChromosome, SpeciesAllele aSpeciesAllele)
anOrganismChromosome
- OrganismChromosome - the organism chromosome of this allele, may not be nullaSpeciesAllele
- - the species allele of this allele, may not be nulljava.lang.IllegalArgumentException
- - input argument(s) illegalpublic OrganismAllele(OrganismChromosome anOrganismChromosome, OrganismAllele anOrganismAllele)
This version of the constructor is used when a child is created from 2 parents and the child's organism chromosomes and organism alleles are inherited from its parents.
anOrganismChromosome
- OrganismChromosome - the organism chromosome parent of this allele, may not be nullanOrganismAllele
- - the organism allele to be copied, may not be nulljava.lang.IllegalArgumentException
- - input argument(s) illegalpublic OrganismAllele(OrganismChromosome anOrganismChromosome, java.lang.String anElementName, int anElementID, com.sun.xml.parser.Parser anXMLParser, ImportContext importContext)
anOrganismChromosome
- OrganismChromosome - the enclosing organism chromosome for this new organism alleleanElementName
- String - the element nameanElementID
- int - the element idanXMLParser
- com.sun.xml.parser.Parser - the element parserimportContext
- ImportContext - import context for mapping ids from file to this worldjava.lang.IllegalArgumentException
- - input arguments illegalMethod Detail |
public void startElement(java.lang.String anElementName, org.xml.sax.AttributeList amap) throws org.xml.sax.SAXException
For internal elements (elements that are non-EngineObject instance variables of this object), call xmlElementContext.startElement() and xmlElementContext will receive the remaining element notifications. For external elements (elements that are EngineObject instance variables of this object), create an object of the appropriate class and that object will receive the remaining element notifications.
startElement
in class org.xml.sax.HandlerBase
anElementName
- String - name of elementamap
- AttributeList - an attribute listpublic void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in class org.xml.sax.HandlerBase
ch
- char[] - charactersstart
- int - start of stringlength
- int - length of stringpublic void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
ignorableWhitespace
in class org.xml.sax.HandlerBase
ch
- char[] - charactersstart
- int - start of stringlength
- int - length of stringpublic void endElement(java.lang.String anElementName) throws org.xml.sax.SAXException
endElement
in interface INucleicAcidHolder
endElement
in class org.xml.sax.HandlerBase
anElementName
- String - the element namepublic void delete()
When this method is called, a property change event is generated for the property named EngineProp.DELETED.
delete
in class EngineObject
public void delete(boolean notifyChange)
public java.lang.String toString()
toString
in class EngineObject
public java.lang.String getTextSymbol()
public void setTextSymbol(java.lang.String aTextSymbol)
aTextSymbol
- String - new text symbol for object, may be nullpublic Gene getGene()
public OrganismChromosome getOrganismChromosome()
public Organism getOrganism()
public Species getSpecies()
public World getWorld()
getWorld
in interface INucleicAcidHolder
getWorld
in class EngineObject
public boolean isMutationAllele()
public SpeciesAllele getSpeciesAllele()
public void setSpeciesAllele(SpeciesAllele aSpeciesAllele)
aSpeciesAllele
- - the organism allele's new species allele, may not be nulljava.lang.IllegalArgumentException
- - input argument(s) illegalpublic int getLengthInBases()
public int getLengthInCodons()
public byte getBase(int index)
index
- int - index into allele, must be 0 to length of allele-1java.lang.IllegalArgumentException
- - input argument(s) illegalBase.getPairBase(byte, int)
public void setBase(int index, byte newBase)
When this property is changed, a property change event is generated for the property named EngineProp.BASE_VALUES.
index
- int - index into allele, must be 0 to length of allele-1newBase
- byte - new base value at given indexjava.lang.IllegalArgumentException
- - input argument(s) illegalpublic void setBases(byte[] newBases)
When this property is changed, a property change event is generated for the property named EngineProp.BASE_VALUES.
newBases
- byte[] - new base values arrayjava.lang.IllegalArgumentException
- - input argument(s) illegalpublic void reconcileBaseChanges()
public java.lang.String getPendingTextSymbol()
public int getStartIndexInHolder()
For an allele, this is always zero as the allele's position in the chromosome isn't known to the allele, but rather its gene.
public void addNucleicAcid(INucleicAcid aNucleicAcid)
This SHOULD be package protected because this is only to be called from the nucleic acid's constructor. Creating a nucleic acid automatically adds it to the holder via this method.
BUT, Java has some wierd idea that interface methods are always public, so I can't make this package protected. So please don't use them method from outside of the engine package!!
addNucleicAcid
in interface INucleicAcidHolder
aNucleicAcid
- INucleicAcid - a new nucleic acid, may not be nulljava.lang.IllegalArgumentException
- - input argument illegalpublic boolean removeNucleicAcid(INucleicAcid aNucleicAcid)
This SHOULD be package protected because this is only to be called from the nucleic acid's delete method. Deleting a nucleic acid automatically removes it from the holder via this method.
BUT, Java has some wierd idea that interface methods are always public, so I can't make this package protected. So please don't use them method from outside of the engine package!!
removeNucleicAcid
in interface INucleicAcidHolder
aNucleicAcid
- INucleicAcid - a nucleic acid, may not be nulljava.lang.IllegalArgumentException
- - input argument illegalpublic void writeToStream(java.io.PrintWriter stream) throws java.io.IOException
We could supply a default implementation that knows how to write the id value. But that convenience is not chosen because it's never correct to use just this implementation of these methods, so I'd rather have a compilation fail if a derived class fails to implement this method.
The inverse of this method is a constructor that takes a org.xml.sax.Parser argument and other arguments.
writeToStream
in class EngineObject
stream
- PrintWriter - print streamjava.lang.IllegalArgumentException
- - input arguments illegaljava.io.IOException
- - an IO error occurred in java libraries
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |