Class CvTermNameComparator

  • All Implemented Interfaces:
    Comparator<CvTerm>

    public class CvTermNameComparator
    extends Object
    implements Comparator<CvTerm>
    Comparator for CvTerms that only takes into consideration the shortName of ths cv term
    Since:
    18/12/12
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • CvTermNameComparator

        public CvTermNameComparator()
        Creates a new CvTermComparator with UnambiguousExternalIdentifierComparator
    • Method Detail

      • compare

        public int compare​(CvTerm cvTerm1,
                           CvTerm cvTerm2)
        Only compares the shortname of two cv terms. The comparison is case insensitive
        Specified by:
        compare in interface Comparator<CvTerm>
        Parameters:
        cvTerm1 - a CvTerm object.
        cvTerm2 - a CvTerm object.
        Returns:
        a int.
      • areEquals

        public static boolean areEquals​(CvTerm cv1,
                                        CvTerm cv2)
        Use UnambiguousCvTermComparator to know if two CvTerms are equals.
        Parameters:
        cv1 - a CvTerm object.
        cv2 - a CvTerm object.
        Returns:
        true if the two CvTerms are equal
      • hashCode

        public static int hashCode​(CvTerm cv1)

        hashCode

        Parameters:
        cv1 - a CvTerm object.
        Returns:
        the hashcode consistent with the equals method for this comparator