Class 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
    • 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 interface Attributable
        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 interface Attributable
        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 interface Attributable
        Parameters:
        name - name of attribute to remove
      • getAttributeNames

        public java.util.Set<java.lang.String> getAttributeNames()
        Specified by:
        getAttributeNames in interface Attributable
        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 interface Attributable
        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 class java.lang.Object
      • compareTo

        public int compareTo​(java.lang.Object o)
        Specified by:
        compareTo in interface java.lang.Comparable
      • equals

        public boolean equals​(Taxon t)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object