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 booleanareEquals(Publication pub1, Publication pub2)Use UnambiguousCuratedPublicationComparator to know if two publications are equals.intcompare(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.UnambiguousPublicationComparatorgetPublicationComparator()Getter for the fieldpublicationComparator.UnambiguousCvTermComparatorgetSourceComparator()Getter for the fieldsourceComparator.static inthashCode(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- aPublicationobject.pub2- aPublicationobject.- Returns:
- true if the two publications are equal
-
hashCode
public static int hashCode(Publication pub)
hashCode
- Parameters:
pub- aPublicationobject.- Returns:
- the hashcode consistent with the equals method for this comparator
-
getPublicationComparator
public UnambiguousPublicationComparator getPublicationComparator()
Getter for the field
publicationComparator.- Overrides:
getPublicationComparatorin classCuratedPublicationComparator- Returns:
- a
Comparatorobject.
-
getSourceComparator
public UnambiguousCvTermComparator getSourceComparator()
Getter for the field
sourceComparator.- Overrides:
getSourceComparatorin classCuratedPublicationComparator- Returns:
- a
Comparatorobject.
-
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:
comparein interfaceComparator<Publication>- Overrides:
comparein classCuratedPublicationComparator- Parameters:
publication1- aPublicationobject.publication2- aPublicationobject.- Returns:
- a int.
-
-