Package org.biojavax.bio.taxa
Class SimpleNCBITaxonName
java.lang.Object
org.biojavax.bio.taxa.SimpleNCBITaxonName
- All Implemented Interfaces:
Comparable
Represents a name class plus name combination for an NCBITaxon object.
- Since:
- 1.5
- Author:
- Richard Holland
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleNCBITaxonName(String nameClass, String name) Creates a new taxon name based on the given class and name, both of which cannot be null. -
Method Summary
Modifier and TypeMethodDescriptionintTaxon names are sorted by class first, then name.booleanTwo taxon names are equal if their name and class match.getName()Returns this name.Returns the class of this name.inthashCode()voidChanges the name.voidsetNameClass(String nameClass) Changes the class of this name.toString()Form: "class:name"
-
Constructor Details
-
SimpleNCBITaxonName
protected SimpleNCBITaxonName() -
SimpleNCBITaxonName
Creates a new taxon name based on the given class and name, both of which cannot be null.- Parameters:
nameClass- the class of the new name. Use one of the constants fromNCBITaxon(for exampleNCBITaxon.SCIENTIFIC).name- the name itself
-
-
Method Details
-
setNameClass
Changes the class of this name.- Parameters:
nameClass- the new class for this name.
-
getNameClass
Returns the class of this name.- Returns:
- the class of this name.
-
setName
Changes the name.- Parameters:
name- the new name.
-
getName
Returns this name.- Returns:
- this name.
-
equals
Two taxon names are equal if their name and class match. -
compareTo
Taxon names are sorted by class first, then name.- Specified by:
compareToin interfaceComparable
-
hashCode
-
toString
Form: "class:name"
-