Class SimpleComparableTerm

    • Method Detail

      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Two terms are equal if they are in the same ontology and share the same name.
        Overrides:
        equals in class java.lang.Object
      • compareTo

        public int compareTo​(java.lang.Object o)
        Terms are sorted by ontology first, then name.
        Specified by:
        compareTo in interface java.lang.Comparable
      • addSynonym

        public void addSynonym​(java.lang.Object synonym)
        Add a synonym for this term. Synonyms are stored in the database as the results of a toString() operation on each synonym object. This doesn't happen until it reaches the database though, so if you are not using a database, don't worry about it.
        Specified by:
        addSynonym in interface Term
        Parameters:
        synonym - the synonym
      • removeSynonym

        public void removeSynonym​(java.lang.Object synonym)
        Remove a synonym for this term.
        Specified by:
        removeSynonym in interface Term
      • getSynonyms

        public java.lang.Object[] getSynonyms()
        Return the synonyms for this term.
        Specified by:
        getSynonyms in interface Term
        Returns:
        the synonyms
      • getRankedCrossRefs

        public java.util.Set getRankedCrossRefs()
        Returns the set of all ranked cross references associated with an object. Warning this method gives access to the original Collection not a copy. This is required by Hibernate. If you modify the object directly the behaviour may be unpredictable.
        Specified by:
        getRankedCrossRefs in interface RankedCrossRefable
        Returns:
        a set of RankedCrossRef objects.
      • setRankedCrossRefs

        public void setRankedCrossRefs​(java.util.Set rankedcrossrefs)
                                throws ChangeVetoException
        Sets the ranked cross references associated with an object. Null will throw an exception but the empty set is fine. Warning this method gives access to the original Collection not a copy. This is required by Hibernate. If you modify the object directly the behaviour may be unpredictable.
        Specified by:
        setRankedCrossRefs in interface RankedCrossRefable
        Parameters:
        rankedcrossrefs - a set of RankedCrossRef objects.
        Throws:
        ChangeVetoException - if the set was null or any of its contents were not RankedCrossRef objects.
      • getName

        public java.lang.String getName()
        Return the name of this term.
        Specified by:
        getName in interface Term
        Returns:
        the name of the term
      • getDescription

        public java.lang.String getDescription()
        Return a human-readable description of this term, or the empty string if none is available.
        Specified by:
        getDescription in interface Term
        Returns:
        the description of the term
      • toString

        public java.lang.String toString()
        Form: "ontology:name [obsolete]" where [obsolete] is optional
        Overrides:
        toString in class java.lang.Object
      • getAnnotation

        public Annotation getAnnotation()
        Should return the associated annotation object. ALWAYS RETURNS AN EMPTY ANNOTATION OBJECT
        Specified by:
        getAnnotation in interface Annotatable
        Returns:
        an Annotation object, never null
      • getIdentifier

        public java.lang.String getIdentifier()
        Returns the (optional) identifier associated with this term.
        Specified by:
        getIdentifier in interface ComparableTerm
        Returns:
        the string identifier.
      • getObsolete

        public java.lang.Boolean getObsolete()
        Checks to see if this term is obsolete. As the column in the database is nullable, this value is a Boolean object instead of a boolean simple type. Hence it may also be null.
        Specified by:
        getObsolete in interface ComparableTerm
        Returns:
        true if it is, false if not.
      • getId

        public java.lang.Integer getId()
        Gets the Hibernate ID. Should be used with caution.
        Returns:
        the Hibernate ID, if using Hibernate.
      • setId

        public void setId​(java.lang.Integer id)
        Sets the Hibernate ID. Should be used with caution.
        Parameters:
        id - the Hibernate ID, if using Hibernate.