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 protectedSimpleNCBITaxonName()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 intcompareTo(Object o)Taxon names are sorted by class first, then name.booleanequals(Object o)Two taxon names are equal if their name and class match.StringgetName()Returns this name.StringgetNameClass()Returns the class of this name.inthashCode()voidsetName(String name)Changes the name.voidsetNameClass(String nameClass)Changes the class of this name.StringtoString()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:
compareToin interfaceComparable
-
-