|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A taxon within a classification.
Taxa may be 'leaf' nodes specifying species, or 'internal' nodes specifying kingdoms and the like.
Nested Class Summary |
Nested classes inherited from class org.biojava.bio.Annotatable |
Annotatable.AnnotationForwarder |
Field Summary | |
static ChangeType |
CHANGE_COMMON_NAME
Change type to indicate that the common name of this Taxon is changing. |
static ChangeType |
CHANGE_SCIENTIFIC_NAME
Change type to indicate that the scientific name of this Taxon is changing. |
Fields inherited from interface org.biojava.bio.Annotatable |
ANNOTATION |
Method Summary | |
boolean |
equals(java.lang.Object o)
Two taxa are equal if they have equivalent children, common and scientific names. |
java.util.Set |
getChildren()
The children of this Taxon. |
java.lang.String |
getCommonName()
The common name of the Taxon. |
Taxon |
getParent()
The parent of this Taxon. |
java.lang.String |
getScientificName()
The scientific name of this taxon. |
int |
hashCode()
The hash-code of a Taxon is equal to the hash-code of it's scientific name. |
void |
setCommonName(java.lang.String commonName)
Set the new common name of this Taxon. |
void |
setScientificName(java.lang.String scientificName)
Change the scientific name of this species. |
Methods inherited from interface org.biojava.bio.Annotatable |
getAnnotation |
Methods inherited from interface org.biojava.utils.Changeable |
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
Field Detail |
public static final ChangeType CHANGE_COMMON_NAME
public static final ChangeType CHANGE_SCIENTIFIC_NAME
Method Detail |
public java.lang.String getCommonName()
The common name of the Taxon.
This is the normal name used in common speech, such as 'human'.
public void setCommonName(java.lang.String commonName) throws ChangeVetoException
Set the new common name of this Taxon.
commonName
- the new common name
ChangeVetoException
- if the name can't be changed at this timepublic java.lang.String getScientificName()
The 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.
public void setScientificName(java.lang.String scientificName) throws ChangeVetoException
scientificName
- the new scientific name
ChangeVetoException
- if the scientific name can't be
changed at this timepublic Taxon getParent()
The parent of this Taxon.
Taxa live within a tree data-structure, so every taxon has a single parent except for the root type. This has the null parent.
public java.util.Set getChildren()
The children of this Taxon.
Taxa live within a tree data-structure, so every taxon has zero or more children. In the case of zero children, the empty set is returned.
? read-only ? dynamicaly updated with taxon object ? copy of data ?
public boolean equals(java.lang.Object o)
Two 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.
o
- the object to check
public int hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |