org.biojava.bio.taxa
Class SimpleTaxon
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojava.bio.taxa.AbstractTaxon
org.biojava.bio.taxa.SimpleTaxon
- All Implemented Interfaces:
- Annotatable, Changeable, Taxon
- public class SimpleTaxon
- extends AbstractTaxon
A no-frills implementatation of Taxon.
A TaxonFactory implementation will probably wish to sub-class
this and add package-private accessors for the parent and children
fields as well as a pacakge-private constructor.
- Author:
- Matthew Pocock
Constructor Summary |
protected |
SimpleTaxon()
|
protected |
SimpleTaxon(java.lang.String scientificName,
java.lang.String commonName)
Create a new instance with no parent, no children and given
scientific and common names. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
parent
protected Taxon parent
children
protected java.util.Set children
SimpleTaxon
protected SimpleTaxon()
SimpleTaxon
protected SimpleTaxon(java.lang.String scientificName,
java.lang.String commonName)
- Create a new instance with no parent, no children and given
scientific and common names.
getParent
public Taxon getParent()
- Description copied from interface:
Taxon
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.
- Returns:
- the parent Taxon, or null if this is the root type.
getChildren
public java.util.Set getChildren()
- Description copied from interface:
Taxon
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 ?
- Returns:
- the Set (possibly empty) of all child Taxa