Class ConfidenceComparator

  • All Implemented Interfaces:
    Comparator<Confidence>
    Direct Known Subclasses:
    UnambiguousConfidenceComparator

    public class ConfidenceComparator
    extends Object
    implements Comparator<Confidence>
    Simple Comparator for Confidences. 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.
    Since:
    18/12/12
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • ConfidenceComparator

        public ConfidenceComparator​(Comparator<CvTerm> termComparator)
        Creates a new ConfidenceComparator.
        Parameters:
        termComparator - : CvTerm comparator for the types and units. It is required
    • Method Detail

      • getCvTermComparator

        public Comparator<CvTerm> getCvTermComparator()

        Getter for the field cvTermComparator.

        Returns:
        a Comparator object.
      • 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.
        Specified by:
        compare in interface Comparator<Confidence>
        Parameters:
        confidence1 - a Confidence object.
        confidence2 - a Confidence object.
        Returns:
        a int.