Interface NCBITaxon

  • All Superinterfaces:
    Changeable, java.lang.Comparable
    All Known Implementing Classes:
    SimpleNCBITaxon

    public interface NCBITaxon
    extends java.lang.Comparable, Changeable
    Represents an NCBI Taxon entry, a combination of the taxon and taxon_name tables in BioSQL.
    Since:
    1.5
    Author:
    Mark Schreiber, Richard Holland
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addName​(java.lang.String nameClass, java.lang.String name)
      Adds the name to this taxon in the given name class.
      boolean containsName​(java.lang.String nameClass, java.lang.String name)
      Tests for the presence of a name in a given class.
      java.lang.String getDisplayName()
      Returns the name of this taxon entry in the form: scientific (common) or if there is no common name: scientific
      java.lang.Integer getGeneticCode()
      Returns the genetic code of this taxon, which may be null if not known.
      java.lang.Integer getLeftValue()
      Gets the left value.
      java.lang.Integer getMitoGeneticCode()
      Returns the mitochondrial genetic code of this taxon, which may be null if not known.
      java.util.Set getNameClasses()
      Returns all the name classes available for a taxon.
      java.lang.String getNameHierarchy()
      Returns the taxonomy hierarchy of this taxon entry in the form: least specific; more specific; ...; most specific.
      java.util.Set getNames​(java.lang.String nameClass)
      Returns all the names available for a taxon in a given class.
      int getNCBITaxID()
      Gets the NCBI taxon ID.
      java.lang.String getNodeRank()
      Gets the node rank of this taxon.
      java.lang.Integer getParentNCBITaxID()
      Returns the parent NCBI taxon ID, if known.
      java.lang.Integer getRightValue()
      Gets the right value.
      boolean isTaxonHidden()
      used in getNameHierarchy() to determine whether this taxonomy level is displayed
      boolean removeName​(java.lang.String nameClass, java.lang.String name)
      Removes the name from the given name class.
      void setGeneticCode​(java.lang.Integer geneticCode)
      Sets the genetic code of this taxon, which may be null, which will unset it.
      void setLeftValue​(java.lang.Integer leftValue)
      Sets the left value.
      void setMitoGeneticCode​(java.lang.Integer mitoGeneticCode)
      Sets the mitochondrial genetic code of this taxon, which may be null, which will unset it.
      void setNodeRank​(java.lang.String nodeRank)
      Sets the node rank of this taxon.
      void setParentNCBITaxID​(java.lang.Integer parent)
      Sets the parent NCBI taxon ID.
      void setRightValue​(java.lang.Integer rightValue)
      Sets the right value.
      void setTaxonHidden​(boolean isTaxonHidden)
      determines whether this taxonomy level is displayed in etNameHierarchy()
      • Methods inherited from interface java.lang.Comparable

        compareTo
    • Field Detail

      • GENETICCODE

        static final ChangeType GENETICCODE
      • MITOGENETICCODE

        static final ChangeType MITOGENETICCODE
      • SCIENTIFIC

        static final java.lang.String SCIENTIFIC
        Use this to define scientific names for things. There should usually only be one scientific name for an organism.
        See Also:
        Constant Field Values
      • COMMON

        static final java.lang.String COMMON
        Use this to define common names for things. There can be as many common names as you like.
        See Also:
        Constant Field Values
      • SYNONYM

        static final java.lang.String SYNONYM
        Use this to define common names for things. There can be as many synonyms as you like.
        See Also:
        Constant Field Values
      • ACRONYM

        static final java.lang.String ACRONYM
        Use this to define acronyms for things. There can be as many acronyms as you like.
        See Also:
        Constant Field Values
      • EQUIVALENT

        static final java.lang.String EQUIVALENT
        Use this to define equivalent names for things. There can be as many equivalent names as you like.
        See Also:
        Constant Field Values
    • Method Detail

      • getNameClasses

        java.util.Set getNameClasses()
        Returns all the name classes available for a taxon. These are Strings.
        Returns:
        a set of name classes, or the empty set if there are none.
      • getNames

        java.util.Set getNames​(java.lang.String nameClass)
                        throws java.lang.IllegalArgumentException
        Returns all the names available for a taxon in a given class. These are Strings.
        Parameters:
        nameClass - the name class to retrieve names from.
        Returns:
        a set of names, or the empty set if there are none.
        Throws:
        java.lang.IllegalArgumentException - if the name is null.
      • addName

        void addName​(java.lang.String nameClass,
                     java.lang.String name)
              throws java.lang.IllegalArgumentException,
                     ChangeVetoException
        Adds the name to this taxon in the given name class. Neither can be null.
        Parameters:
        nameClass - the class to add the name in.
        name - the name to add.
        Throws:
        ChangeVetoException - in case of objections.
        java.lang.IllegalArgumentException - if the name is null.
      • removeName

        boolean removeName​(java.lang.String nameClass,
                           java.lang.String name)
                    throws java.lang.IllegalArgumentException,
                           ChangeVetoException
        Removes the name from the given name class. Neither can be null.
        Parameters:
        nameClass - the class to remove the name from.
        name - the name to remove.
        Returns:
        True if the name was found and removed, false otherwise.
        Throws:
        ChangeVetoException - in case of objections.
        java.lang.IllegalArgumentException - if the name is null.
      • containsName

        boolean containsName​(java.lang.String nameClass,
                             java.lang.String name)
                      throws java.lang.IllegalArgumentException
        Tests for the presence of a name in a given class. Neither can be null.
        Parameters:
        nameClass - the class to look the name up in.
        name - the name to text for existence of.
        Returns:
        True if the name exists in that class, false otherwise.
        Throws:
        java.lang.IllegalArgumentException - if the name is null.
      • getParentNCBITaxID

        java.lang.Integer getParentNCBITaxID()
        Returns the parent NCBI taxon ID, if known.
        Returns:
        Value of property parent.
      • setParentNCBITaxID

        void setParentNCBITaxID​(java.lang.Integer parent)
                         throws ChangeVetoException
        Sets the parent NCBI taxon ID. May be null if not known.
        Parameters:
        parent - New value of property parent.
        Throws:
        ChangeVetoException - in case of objections.
      • getNCBITaxID

        int getNCBITaxID()
        Gets the NCBI taxon ID. This is never null and is immutable, as otherwise we would have no way of distinguishing between various taxa. It should be set by the constructor of an implementation.
        Returns:
        Value of property NCBITaxID.
      • getNodeRank

        java.lang.String getNodeRank()
        Gets the node rank of this taxon. May be null.
        Returns:
        Value of property nodeRank.
      • setNodeRank

        void setNodeRank​(java.lang.String nodeRank)
                  throws ChangeVetoException
        Sets the node rank of this taxon. May be null, in which case it is unset.
        Parameters:
        nodeRank - New value of property nodeRank.
        Throws:
        ChangeVetoException - in case of objections.
      • getGeneticCode

        java.lang.Integer getGeneticCode()
        Returns the genetic code of this taxon, which may be null if not known.
        Returns:
        Value of property geneticCode.
      • setGeneticCode

        void setGeneticCode​(java.lang.Integer geneticCode)
                     throws ChangeVetoException
        Sets the genetic code of this taxon, which may be null, which will unset it.
        Parameters:
        geneticCode - New value of property geneticCode.
        Throws:
        ChangeVetoException - in case of objections.
      • getMitoGeneticCode

        java.lang.Integer getMitoGeneticCode()
        Returns the mitochondrial genetic code of this taxon, which may be null if not known.
        Returns:
        Value of property mitoGeneticCode.
      • setMitoGeneticCode

        void setMitoGeneticCode​(java.lang.Integer mitoGeneticCode)
                         throws ChangeVetoException
        Sets the mitochondrial genetic code of this taxon, which may be null, which will unset it.
        Parameters:
        mitoGeneticCode - New value of property mitoGeneticCode.
        Throws:
        ChangeVetoException - in case of objections.
      • getLeftValue

        java.lang.Integer getLeftValue()
        Gets the left value. May be null.
        Returns:
        Value of property leftValue.
      • setLeftValue

        void setLeftValue​(java.lang.Integer leftValue)
                   throws ChangeVetoException
        Sets the left value. May be null.
        Parameters:
        leftValue - New value of property leftValue.
        Throws:
        ChangeVetoException - in case of objections.
      • getRightValue

        java.lang.Integer getRightValue()
        Gets the right value. May be null.
        Returns:
        Value of property rightValue.
      • setRightValue

        void setRightValue​(java.lang.Integer rightValue)
                    throws ChangeVetoException
        Sets the right value. May be null.
        Parameters:
        rightValue - New value of property rightValue.
        Throws:
        ChangeVetoException - in case of objections.
      • getDisplayName

        java.lang.String getDisplayName()
        Returns the name of this taxon entry in the form: scientific (common) or if there is no common name: scientific
        Returns:
        the display name as described above.
      • getNameHierarchy

        java.lang.String getNameHierarchy()
        Returns the taxonomy hierarchy of this taxon entry in the form: least specific; more specific; ...; most specific. It follows the chain up the tree as far as it can, and will stop at the first one it comes to that returns null for getParentNCBITaxID()
        Returns:
        the display name as described above.
      • isTaxonHidden

        boolean isTaxonHidden()
        used in getNameHierarchy() to determine whether this taxonomy level is displayed
      • setTaxonHidden

        void setTaxonHidden​(boolean isTaxonHidden)
                     throws ChangeVetoException
        determines whether this taxonomy level is displayed in etNameHierarchy()
        Parameters:
        isTaxonHidden - - if true it is displayed
        Throws:
        ChangeVetoException