Class AbstractTaxon
- All Implemented Interfaces:
Annotatable,Taxon,Changeable
- Direct Known Subclasses:
SimpleTaxon,WeakTaxon
An abstract implementation of Taxon.
It is left up to the impementor to provide methods for accessing the parent and children. All other state is provided for here. A common pattern would be to route any Taxon.getParent() call back via a method on the TaxonFactory used to generate this instance.
- Since:
- 1.3
- Author:
- Matthew Pocock, Keith James
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarder -
Field Summary
Fields inherited from interface org.biojava.bio.Annotatable
ANNOTATIONFields inherited from interface org.biojava.bio.taxa.Taxon
CHANGE_COMMON_NAME, CHANGE_SCIENTIFIC_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeprecated.protectedAbstractTaxon(String scientificName, String commonName) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Two taxa are equal if they have equivalent children, common and scientific names.Deprecated.Should return the associated annotation object.protected ChangeSupportDeprecated.Called to retrieve the ChangeSupport for this object.Deprecated.The common name of the Taxon.Deprecated.The scientific name of this taxon.inthashCode()Deprecated.The hash-code of a Taxon is equal to the hash-code of it's scientific name.voidsetCommonName(String commonName) Deprecated.Set the new common name of this Taxon.voidsetScientificName(String scientificName) Deprecated.Change the scientific name of this species.toString()Deprecated.Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerMethods inherited from interface org.biojava.bio.taxa.Taxon
getChildren, getParent
-
Constructor Details
-
AbstractTaxon
protected AbstractTaxon()Deprecated. -
AbstractTaxon
Deprecated.
-
-
Method Details
-
getChangeSupport
Deprecated.Description copied from class:AbstractChangeableCalled to retrieve the ChangeSupport for this object.Your implementation of this method should have the following structure:
It is usual for the forwarding listeners (someForwarder in this example) to be transient and lazily instantiated. Be sure to register & unregister the forwarder in the code that does the ChangeEvent handling in setter methods.ChangeSupport cs = super.getChangeSupport(ct); if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) { someForwarder = new ChangeForwarder(... this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange); } return cs;- Overrides:
getChangeSupportin classAbstractChangeable
-
getCommonName
Deprecated.Description copied from interface:TaxonThe common name of the Taxon.
This is the normal name used in common speech, such as 'human'.
- Specified by:
getCommonNamein interfaceTaxon- Returns:
- a String representing this Taxon's common name
-
setCommonName
Deprecated.Description copied from interface:TaxonSet the new common name of this Taxon.
- Specified by:
setCommonNamein interfaceTaxon- Parameters:
commonName- the new common name- Throws:
ChangeVetoException- if the name can't be changed at this time
-
getScientificName
Deprecated.Description copied from interface:TaxonThe scientific name of this taxon.
This will be the portion of the scientific classification pertaining to just this node within the classifictaion. It will be something like 'homo sapiens' or 'archaeal group 2', rather than the full classification list.
- Specified by:
getScientificNamein interfaceTaxon
-
setScientificName
Deprecated.Description copied from interface:TaxonChange the scientific name of this species.- Specified by:
setScientificNamein interfaceTaxon- Parameters:
scientificName- the new scientific name- Throws:
ChangeVetoException- if the scientific name can't be changed at this time
-
getAnnotation
Deprecated.Description copied from interface:AnnotatableShould return the associated annotation object.- Specified by:
getAnnotationin interfaceAnnotatable- Returns:
- an Annotation object, never null
-
equals
Deprecated.Description copied from interface:TaxonTwo taxa are equal if they have equivalent children, common and scientific names.
Two different implementations of Taxon should be able to appropriately trans-class equality. The parent of a Taxon is not considered in testing equality as this potentially leads to combinatorial problems checking whole taxa hierachies against one another.
-
toString
Deprecated. -
hashCode
Deprecated.Description copied from interface:TaxonThe hash-code of a Taxon is equal to the hash-code of it's scientific name.
-
org.biojavax.bio.taxa