Package org.biojavax.bio.taxa
Interface NCBITaxon
- All Superinterfaces:
Changeable
,Comparable
- All Known Implementing Classes:
SimpleNCBITaxon
Represents an NCBI Taxon entry, a combination of the taxon and taxon_name
tables in BioSQL.
- Since:
- 1.5
- Author:
- Mark Schreiber, Richard Holland
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Use this to define acronyms for things.static final String
Use this to define common names for things.static final String
Use this to define equivalent names for things.static final ChangeType
static final ChangeType
static final ChangeType
static final ChangeType
static final ChangeType
static final ChangeType
static final ChangeType
static final ChangeType
static final String
Use this to define scientific names for things.static final String
Use this to define common names for things. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the name to this taxon in the given name class.boolean
containsName
(String nameClass, String name) Tests for the presence of a name in a given class.Returns the name of this taxon entry in the form: scientific (common) or if there is no common name: scientificReturns the genetic code of this taxon, which may be null if not known.Gets the left value.Returns the mitochondrial genetic code of this taxon, which may be null if not known.Returns all the name classes available for a taxon.Returns the taxonomy hierarchy of this taxon entry in the form: least specific; more specific; ...; most specific.Returns all the names available for a taxon in a given class.int
Gets the NCBI taxon ID.Gets the node rank of this taxon.Returns the parent NCBI taxon ID, if known.Gets the right value.boolean
used in getNameHierarchy() to determine whether this taxonomy level is displayedboolean
removeName
(String nameClass, String name) Removes the name from the given name class.void
setGeneticCode
(Integer geneticCode) Sets the genetic code of this taxon, which may be null, which will unset it.void
setLeftValue
(Integer leftValue) Sets the left value.void
setMitoGeneticCode
(Integer mitoGeneticCode) Sets the mitochondrial genetic code of this taxon, which may be null, which will unset it.void
setNodeRank
(String nodeRank) Sets the node rank of this taxon.void
setParentNCBITaxID
(Integer parent) Sets the parent NCBI taxon ID.void
setRightValue
(Integer rightValue) Sets the right value.void
setTaxonHidden
(boolean isTaxonHidden) determines whether this taxonomy level is displayed in etNameHierarchy()Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
NAMES
-
PARENT
-
NODERANK
-
GENETICCODE
-
MITOGENETICCODE
-
LEFTVALUE
-
RIGHTVALUE
-
HIDDEN
-
SCIENTIFIC
Use this to define scientific names for things. There should usually only be one scientific name for an organism.- See Also:
-
COMMON
Use this to define common names for things. There can be as many common names as you like.- See Also:
-
SYNONYM
Use this to define common names for things. There can be as many synonyms as you like.- See Also:
-
ACRONYM
Use this to define acronyms for things. There can be as many acronyms as you like.- See Also:
-
EQUIVALENT
Use this to define equivalent names for things. There can be as many equivalent names as you like.- See Also:
-
-
Method Details
-
getNameClasses
Returns all the name classes available for a taxon. These are Strings.- Returns:
- a set of name classes, or the empty set if there are none.
-
getNames
Returns all the names available for a taxon in a given class. These are Strings.- Parameters:
nameClass
- the name class to retrieve names from.- Returns:
- a set of names, or the empty set if there are none.
- Throws:
IllegalArgumentException
- if the name is null.
-
addName
Adds the name to this taxon in the given name class. Neither can be null.- Parameters:
nameClass
- the class to add the name in.name
- the name to add.- Throws:
ChangeVetoException
- in case of objections.IllegalArgumentException
- if the name is null.
-
removeName
boolean removeName(String nameClass, String name) throws IllegalArgumentException, ChangeVetoException Removes the name from the given name class. Neither can be null.- Parameters:
nameClass
- the class to remove the name from.name
- the name to remove.- Returns:
- True if the name was found and removed, false otherwise.
- Throws:
ChangeVetoException
- in case of objections.IllegalArgumentException
- if the name is null.
-
containsName
Tests for the presence of a name in a given class. Neither can be null.- Parameters:
nameClass
- the class to look the name up in.name
- the name to text for existence of.- Returns:
- True if the name exists in that class, false otherwise.
- Throws:
IllegalArgumentException
- if the name is null.
-
getParentNCBITaxID
Returns the parent NCBI taxon ID, if known.- Returns:
- Value of property parent.
-
setParentNCBITaxID
Sets the parent NCBI taxon ID. May be null if not known.- Parameters:
parent
- New value of property parent.- Throws:
ChangeVetoException
- in case of objections.
-
getNCBITaxID
int getNCBITaxID()Gets the NCBI taxon ID. This is never null and is immutable, as otherwise we would have no way of distinguishing between various taxa. It should be set by the constructor of an implementation.- Returns:
- Value of property NCBITaxID.
-
getNodeRank
Gets the node rank of this taxon. May be null.- Returns:
- Value of property nodeRank.
-
setNodeRank
Sets the node rank of this taxon. May be null, in which case it is unset.- Parameters:
nodeRank
- New value of property nodeRank.- Throws:
ChangeVetoException
- in case of objections.
-
getGeneticCode
Returns the genetic code of this taxon, which may be null if not known.- Returns:
- Value of property geneticCode.
-
setGeneticCode
Sets the genetic code of this taxon, which may be null, which will unset it.- Parameters:
geneticCode
- New value of property geneticCode.- Throws:
ChangeVetoException
- in case of objections.
-
getMitoGeneticCode
Returns the mitochondrial genetic code of this taxon, which may be null if not known.- Returns:
- Value of property mitoGeneticCode.
-
setMitoGeneticCode
Sets the mitochondrial genetic code of this taxon, which may be null, which will unset it.- Parameters:
mitoGeneticCode
- New value of property mitoGeneticCode.- Throws:
ChangeVetoException
- in case of objections.
-
getLeftValue
Gets the left value. May be null.- Returns:
- Value of property leftValue.
-
setLeftValue
Sets the left value. May be null.- Parameters:
leftValue
- New value of property leftValue.- Throws:
ChangeVetoException
- in case of objections.
-
getRightValue
Gets the right value. May be null.- Returns:
- Value of property rightValue.
-
setRightValue
Sets the right value. May be null.- Parameters:
rightValue
- New value of property rightValue.- Throws:
ChangeVetoException
- in case of objections.
-
getDisplayName
Returns the name of this taxon entry in the form: scientific (common) or if there is no common name: scientific- Returns:
- the display name as described above.
-
getNameHierarchy
Returns the taxonomy hierarchy of this taxon entry in the form: least specific; more specific; ...; most specific. It follows the chain up the tree as far as it can, and will stop at the first one it comes to that returns null for getParentNCBITaxID()- Returns:
- the display name as described above.
-
isTaxonHidden
boolean isTaxonHidden()used in getNameHierarchy() to determine whether this taxonomy level is displayed -
setTaxonHidden
determines whether this taxonomy level is displayed in etNameHierarchy()- Parameters:
isTaxonHidden
- - if true it is displayed- Throws:
ChangeVetoException
-