Class UnambiguousChecksumComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.checksum.ChecksumComparator
-
- psidev.psi.mi.jami.utils.comparator.checksum.UnambiguousChecksumComparator
-
- All Implemented Interfaces:
Comparator<Checksum>
public class UnambiguousChecksumComparator extends ChecksumComparator
Unambiguous checksum comparator. - Two checksum which are null are equals - The checksum which is not null is before null. - use UnambiguousCvTermComparator to compare the methods. If they are equals, compares the values (case sensitive)- Since:
18/12/12
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description UnambiguousChecksumComparator()
Constructor for UnambiguousChecksumComparator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(Checksum checksum1, Checksum checksum2)
Use UnambiguousChecksumComparator to know if two checksum are equals.int
compare(Checksum checksum1, Checksum checksum2)
It will first compares the method using a UnambiguousCvTermComparator and then it will compare the checksum values - Two annotations which are null are equals - The annotation which is not null is before null.UnambiguousCvTermComparator
getMethodComparator()
Getter for the fieldmethodComparator
.static int
hashCode(Checksum checksum)
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
-
getMethodComparator
public UnambiguousCvTermComparator getMethodComparator()
Getter for the field
methodComparator
.- Overrides:
getMethodComparator
in classChecksumComparator
- Returns:
- a
Comparator
object.
-
compare
public int compare(Checksum checksum1, Checksum checksum2)
It will first compares the method using a UnambiguousCvTermComparator and then it will compare the checksum values - Two annotations which are null are equals - The annotation which is not null is before null. - use UnambiguousCvTermComparator to compare the topics. If they are equals, compares the values (case insensitive) - If both annotations have same topic, the one with a null value is always after the one with a non null value.- Specified by:
compare
in interfaceComparator<Checksum>
- Overrides:
compare
in classChecksumComparator
- Parameters:
checksum1
- aChecksum
object.checksum2
- aChecksum
object.- Returns:
- a int.
-
areEquals
public static boolean areEquals(Checksum checksum1, Checksum checksum2)
Use UnambiguousChecksumComparator to know if two checksum are equals.
-
-