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 intcompareTo(java.lang.Object o)booleanequals(Taxon t)static java.util.Set<Taxon>getAllTaxa()java.lang.ObjectgetAttribute(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.StringgetName()get the name of the taxonstatic TaxongetTaxon(java.lang.String name)A static method that returns a Taxon object with the given name.TaxonomicLevelgetTaxonomicLevel()get the taxonomic level of the taxoninthashCode()voidremoveAttribute(java.lang.String name)voidsetAttribute(java.lang.String name, java.lang.Object value)Sets an named attribute for this object.java.lang.StringtoString()
-
-
-
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:AttributableSets an named attribute for this object.- Specified by:
setAttributein 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:
getAttributein 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:
removeAttributein interfaceAttributable- Parameters:
name- name of attribute to remove
-
getAttributeNames
public java.util.Set<java.lang.String> getAttributeNames()
- Specified by:
getAttributeNamesin 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:AttributableGets the entire attribute map.- Specified by:
getAttributeMapin 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:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareToin interfacejava.lang.Comparable
-
equals
public boolean equals(Taxon t)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-