Class ChecksumComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.checksum.ChecksumComparator
-
- All Implemented Interfaces:
Comparator<Checksum>
- Direct Known Subclasses:
UnambiguousChecksumComparator
public class ChecksumComparator extends Object implements Comparator<Checksum>
Simple comparator for checksum. It will first compares the method using a CvTermComparator 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 DefaultCvTermComparator 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.- Since:
18/12/12
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description ChecksumComparator(Comparator<CvTerm> termComparator)
Creates a new ChecksumComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Checksum checksum1, Checksum checksum2)
It will first compares the method using a CvTermComparator and then it will compare the checksum values - Two annotations which are null are equals - The annotation which is not null is before null.Comparator<CvTerm>
getMethodComparator()
Getter for the fieldmethodComparator
.-
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
-
ChecksumComparator
public ChecksumComparator(Comparator<CvTerm> termComparator)
Creates a new ChecksumComparator.- Parameters:
termComparator
- : comparator for the method which is required
-
-
Method Detail
-
getMethodComparator
public Comparator<CvTerm> getMethodComparator()
Getter for the field
methodComparator
.- Returns:
- a
Comparator
object.
-
compare
public int compare(Checksum checksum1, Checksum checksum2)
It will first compares the method using a CvTermComparator 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 CvTermComparator 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>
- Parameters:
checksum1
- : the first checksumchecksum2
- : the second checksum- Returns:
- the comparison value
-
-