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 booleanareEquals(Checksum checksum1, Checksum checksum2)Use UnambiguousChecksumComparator to know if two checksum are equals.intcompare(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.UnambiguousCvTermComparatorgetMethodComparator()Getter for the fieldmethodComparator.static inthashCode(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:
getMethodComparatorin classChecksumComparator- Returns:
- a
Comparatorobject.
-
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:
comparein interfaceComparator<Checksum>- Overrides:
comparein classChecksumComparator- Parameters:
checksum1- aChecksumobject.checksum2- aChecksumobject.- Returns:
- a int.
-
areEquals
public static boolean areEquals(Checksum checksum1, Checksum checksum2)
Use UnambiguousChecksumComparator to know if two checksum are equals.
-
-