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 booleanareEquals(Confidence conf1, Confidence conf2)Use UnambiguousConfidenceComparator to know if two confidences are equals.intcompare(Confidence confidence1, Confidence confidence2)It will compares the confidence types first, then the units and finally the value.UnambiguousCvTermComparatorgetCvTermComparator()getCvTermComparatorstatic inthashCode(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:
getCvTermComparatorin classConfidenceComparator- Returns:
- a
UnambiguousCvTermComparatorobject.
-
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:
comparein interfaceComparator<Confidence>- Overrides:
comparein classConfidenceComparator- Parameters:
confidence1- aConfidenceobject.confidence2- aConfidenceobject.- Returns:
- a int.
-
areEquals
public static boolean areEquals(Confidence conf1, Confidence conf2)
Use UnambiguousConfidenceComparator to know if two confidences are equals.- Parameters:
conf1- aConfidenceobject.conf2- aConfidenceobject.- Returns:
- true if the two confidences are equal
-
hashCode
public static int hashCode(Confidence conf)
hashCode
- Parameters:
conf- aConfidenceobject.- Returns:
- the hashcode consistent with the equals method for this comparator
-
-