Class UnambiguousConfidenceComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.confidence.ConfidenceComparator
-
- psidev.psi.mi.jami.utils.comparator.confidence.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 Summary
Constructors Constructor Description UnambiguousConfidenceComparator()
Constructor for UnambiguousConfidenceComparator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(Confidence conf1, Confidence conf2)
Use UnambiguousConfidenceComparator to know if two confidences are equals.int
compare(Confidence confidence1, Confidence confidence2)
It will compares the confidence types first, then the units and finally the value.UnambiguousCvTermComparator
getCvTermComparator()
getCvTermComparatorstatic int
hashCode(Confidence conf)
hashCode-
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
-
-
-
-
Method Detail
-
getCvTermComparator
public UnambiguousCvTermComparator getCvTermComparator()
getCvTermComparator
- Overrides:
getCvTermComparator
in classConfidenceComparator
- Returns:
- a
UnambiguousCvTermComparator
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. - 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 interfaceComparator<Confidence>
- Overrides:
compare
in classConfidenceComparator
- Parameters:
confidence1
- aConfidence
object.confidence2
- aConfidence
object.- Returns:
- a int.
-
areEquals
public static boolean areEquals(Confidence conf1, Confidence conf2)
Use UnambiguousConfidenceComparator to know if two confidences are equals.- Parameters:
conf1
- aConfidence
object.conf2
- aConfidence
object.- Returns:
- true if the two confidences are equal
-
hashCode
public static int hashCode(Confidence conf)
hashCode
- Parameters:
conf
- aConfidence
object.- Returns:
- the hashcode consistent with the equals method for this comparator
-
-