Class UnambiguousConfidenceComparator

  • All Implemented Interfaces:
    Comparator<Confidence>

    public class UnambiguousConfidenceComparator
    extends ConfidenceComparator
    Unambiguous confidence comparator. It will compares the confidence types first, then the units and finally the value. - Two confidences which are null are equals - The confidence which is not null is before null. - Use UnambiguousCvTermComparator to compare first the confidence types. - If confidence types are equals, use UnambiguousCvTermComparator to compare the units. - If the units are not set, compares the values (case sensitive) - If both units are set and If they are equals, compares the values (case sensitive) - The confidence (same type, same value) with unit which is not null will be before the one with a null unit
    Since:
    18/12/12
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • UnambiguousConfidenceComparator

        public UnambiguousConfidenceComparator()

        Constructor for UnambiguousConfidenceComparator.

    • Method Detail

      • compare

        public int compare​(Confidence confidence1,
                           Confidence confidence2)
        It will compares the confidence types first, then the units and finally the value. - Two confidences which are null are equals - The confidence which is not null is before null. - Use UnambiguousCvTermComparator to compare first the confidence types. - If confidence types are equals, use UnambiguousCvTermComparator to compare the units. - If the units are not set, compares the values (case sensitive) - If both units are set and If they are equals, compares the values (case sensitive) - The confidence (same type, same value) with unit which is not null will be before the one with a null unit
        Specified by:
        compare in interface Comparator<Confidence>
        Overrides:
        compare in class ConfidenceComparator
        Parameters:
        confidence1 - a Confidence object.
        confidence2 - a Confidence object.
        Returns:
        a int.
      • areEquals

        public static boolean areEquals​(Confidence conf1,
                                        Confidence conf2)
        Use UnambiguousConfidenceComparator to know if two confidences are equals.
        Parameters:
        conf1 - a Confidence object.
        conf2 - a Confidence object.
        Returns:
        true if the two confidences are equal
      • hashCode

        public static int hashCode​(Confidence conf)

        hashCode

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