Class ConfidenceComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.confidence.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 Summary
Constructors Constructor Description ConfidenceComparator(Comparator<CvTerm> termComparator)
Creates a new ConfidenceComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Confidence confidence1, Confidence confidence2)
It will compares the confidence types first, then the units and finally the value.Comparator<CvTerm>
getCvTermComparator()
Getter for the fieldcvTermComparator
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
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 interfaceComparator<Confidence>
- Parameters:
confidence1
- aConfidence
object.confidence2
- aConfidence
object.- Returns:
- a int.
-
-