Class UnambiguousCuratedPublicationComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.publication.CuratedPublicationComparator
-
- psidev.psi.mi.jami.utils.comparator.publication.UnambiguousCuratedPublicationComparator
-
- All Implemented Interfaces:
Comparator<Publication>
public class UnambiguousCuratedPublicationComparator extends CuratedPublicationComparator
Unambiguous curated publication comparator. It uses a UnambiguousPublicationComparator to compares the bibliographic details and then will compare first the curation depth, then the source using UnambiguousCvTermComparator and then the released date.- Since:
21/12/12
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description UnambiguousCuratedPublicationComparator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(Publication pub1, Publication pub2)
Use UnambiguousCuratedPublicationComparator to know if two publications are equals.int
compare(Publication publication1, Publication publication2)
It uses a AbstractPublicationComparator to compares the bibliographic details and then will compare first the curation depth, then the source and then the released date.UnambiguousPublicationComparator
getPublicationComparator()
Getter for the fieldpublicationComparator
.UnambiguousCvTermComparator
getSourceComparator()
Getter for the fieldsourceComparator
.static int
hashCode(Publication pub)
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
-
areEquals
public static boolean areEquals(Publication pub1, Publication pub2)
Use UnambiguousCuratedPublicationComparator to know if two publications are equals.- Parameters:
pub1
- aPublication
object.pub2
- aPublication
object.- Returns:
- true if the two publications are equal
-
hashCode
public static int hashCode(Publication pub)
hashCode
- Parameters:
pub
- aPublication
object.- Returns:
- the hashcode consistent with the equals method for this comparator
-
getPublicationComparator
public UnambiguousPublicationComparator getPublicationComparator()
Getter for the field
publicationComparator
.- Overrides:
getPublicationComparator
in classCuratedPublicationComparator
- Returns:
- a
Comparator
object.
-
getSourceComparator
public UnambiguousCvTermComparator getSourceComparator()
Getter for the field
sourceComparator
.- Overrides:
getSourceComparator
in classCuratedPublicationComparator
- Returns:
- a
Comparator
object.
-
compare
public int compare(Publication publication1, Publication publication2)
It uses a AbstractPublicationComparator to compares the bibliographic details and then will compare first the curation depth, then the source and then the released date. It uses a UnambiguousPublicationComparator to compares the bibliographic details and then will compare first the curation depth, then the source using UnambiguousCvTermComparator and then the released date.- Specified by:
compare
in interfaceComparator<Publication>
- Overrides:
compare
in classCuratedPublicationComparator
- Parameters:
publication1
- aPublication
object.publication2
- aPublication
object.- Returns:
- a int.
-
-