Package org.biojavax.bio.taxa
Class SimpleNCBITaxonName
- java.lang.Object
-
- org.biojavax.bio.taxa.SimpleNCBITaxonName
-
- All Implemented Interfaces:
Comparable
public class SimpleNCBITaxonName extends Object implements Comparable
Represents a name class plus name combination for an NCBITaxon object.- Since:
- 1.5
- Author:
- Richard Holland
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimpleNCBITaxonName()
SimpleNCBITaxonName(String nameClass, String name)
Creates a new taxon name based on the given class and name, both of which cannot be null.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object o)
Taxon names are sorted by class first, then name.boolean
equals(Object o)
Two taxon names are equal if their name and class match.String
getName()
Returns this name.String
getNameClass()
Returns the class of this name.int
hashCode()
void
setName(String name)
Changes the name.void
setNameClass(String nameClass)
Changes the class of this name.String
toString()
Form: "class:name"
-
-
-
Constructor Detail
-
SimpleNCBITaxonName
protected SimpleNCBITaxonName()
-
SimpleNCBITaxonName
public SimpleNCBITaxonName(String nameClass, String name)
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 Detail
-
setNameClass
public void setNameClass(String nameClass)
Changes the class of this name.- Parameters:
nameClass
- the new class for this name.
-
getNameClass
public String getNameClass()
Returns the class of this name.- Returns:
- the class of this name.
-
compareTo
public int compareTo(Object o)
Taxon names are sorted by class first, then name.- Specified by:
compareTo
in interfaceComparable
-
-