jebl.evolution.taxa
Class Taxon

java.lang.Object
  extended by jebl.evolution.taxa.Taxon
All Implemented Interfaces:
Comparable, Attributable

public final class Taxon
extends Object
implements Attributable, Comparable

Author:
Andrew Rambaut, Alexei Drummond

Nested Class Summary
 
Nested classes/interfaces inherited from interface jebl.util.Attributable
Attributable.Utils
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Taxon t)
           
static Set<Taxon> getAllTaxa()
           
 Object getAttribute(String name)
           
 Map<String,Object> getAttributeMap()
          Gets the entire attribute map.
 Set<String> getAttributeNames()
           
 String getName()
          get the name of the taxon
static Taxon getTaxon(String name)
          A static method that returns a Taxon object with the given name.
 TaxonomicLevel getTaxonomicLevel()
          get the taxonomic level of the taxon
 int hashCode()
           
 void removeAttribute(String name)
           
 void setAttribute(String name, Object value)
          Sets an named attribute for this object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public 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(String name,
                         Object value)
Description copied from interface: Attributable
Sets an named attribute for this object.

Specified by:
setAttribute in interface Attributable
Parameters:
name - the name of the attribute.
value - the new value of the attribute.

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface Attributable
Parameters:
name - the name of the attribute of interest.
Returns:
an object representing the named attributed for this object.

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface Attributable
Parameters:
name - name of attribute to remove

getAttributeNames

public Set<String> getAttributeNames()
Specified by:
getAttributeNames in interface Attributable
Returns:
an array of the attributeNames that this object has.

getAttributeMap

public Map<String,Object> getAttributeMap()
Description copied from interface: Attributable
Gets the entire attribute map.

Specified by:
getAttributeMap in interface Attributable
Returns:
an unmodifiable map

getAllTaxa

public static Set<Taxon> getAllTaxa()
Returns:
a Set containing all the currently created Taxon objects.

getTaxon

public static Taxon getTaxon(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 String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

equals

public boolean equals(Taxon t)

hashCode

public int hashCode()
Overrides:
hashCode in class Object