Package jebl.evolution.taxa
Class Taxon
- java.lang.Object
-
- jebl.evolution.taxa.Taxon
-
- All Implemented Interfaces:
java.lang.Comparable
,Attributable
public final class Taxon extends java.lang.Object implements Attributable, java.lang.Comparable
- Version:
- $Id: Taxon.java 1008 2009-07-19 23:08:37Z matt_kearse $
- Author:
- Andrew Rambaut, Alexei Drummond
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jebl.util.Attributable
Attributable.Utils
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(java.lang.Object o)
boolean
equals(Taxon t)
static java.util.Set<Taxon>
getAllTaxa()
java.lang.Object
getAttribute(java.lang.String name)
java.util.Map<java.lang.String,java.lang.Object>
getAttributeMap()
Gets the entire attribute map.java.util.Set<java.lang.String>
getAttributeNames()
java.lang.String
getName()
get the name of the taxonstatic Taxon
getTaxon(java.lang.String name)
A static method that returns a Taxon object with the given name.TaxonomicLevel
getTaxonomicLevel()
get the taxonomic level of the taxonint
hashCode()
void
removeAttribute(java.lang.String name)
void
setAttribute(java.lang.String name, java.lang.Object value)
Sets an named attribute for this object.java.lang.String
toString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
get the name of the taxon- Returns:
- the name
-
getTaxonomicLevel
public TaxonomicLevel getTaxonomicLevel()
get the taxonomic level of the taxon- Returns:
- the taxonomic level
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)
Description copied from interface:Attributable
Sets an named attribute for this object.- Specified by:
setAttribute
in interfaceAttributable
- Parameters:
name
- the name of the attribute.value
- the new value of the attribute.
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
- Specified by:
getAttribute
in interfaceAttributable
- Parameters:
name
- the name of the attribute of interest, or null if the attribute doesn't exist.- Returns:
- an object representing the named attributed for this object.
-
removeAttribute
public void removeAttribute(java.lang.String name)
- Specified by:
removeAttribute
in interfaceAttributable
- Parameters:
name
- name of attribute to remove
-
getAttributeNames
public java.util.Set<java.lang.String> getAttributeNames()
- Specified by:
getAttributeNames
in interfaceAttributable
- Returns:
- an array of the attributeNames that this object has.
-
getAttributeMap
public java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()
Description copied from interface:Attributable
Gets the entire attribute map.- Specified by:
getAttributeMap
in interfaceAttributable
- Returns:
- an unmodifiable map
-
getAllTaxa
public static java.util.Set<Taxon> getAllTaxa()
- Returns:
- a Set containing all the currently created Taxon objects.
-
getTaxon
public static Taxon getTaxon(java.lang.String name)
A static method that returns a Taxon object with the given name. If this has already been created then the same instance will be returned.- Parameters:
name
-- Returns:
- the taxon
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareTo
in interfacejava.lang.Comparable
-
equals
public boolean equals(Taxon t)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-