Class CuratedPublicationComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.publication.CuratedPublicationComparator
-
- All Implemented Interfaces:
Comparator<Publication>
- Direct Known Subclasses:
UnambiguousCuratedPublicationComparator
public class CuratedPublicationComparator extends Object implements Comparator<Publication>
Simple comparator for curated publications. 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.- Since:
21/12/12
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description CuratedPublicationComparator(Comparator<Publication> pubComparator, Comparator<CvTerm> sourceComparator)Creates a new CuratedPublicationComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.Comparator<Publication>getPublicationComparator()Getter for the fieldpublicationComparator.Comparator<CvTerm>getSourceComparator()Getter for the fieldsourceComparator.-
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
-
CuratedPublicationComparator
public CuratedPublicationComparator(Comparator<Publication> pubComparator, Comparator<CvTerm> sourceComparator)
Creates a new CuratedPublicationComparator.- Parameters:
pubComparator- : the comparator for the publication (not curation information). It is requiredsourceComparator- : the source comparator
-
-
Method Detail
-
getPublicationComparator
public Comparator<Publication> getPublicationComparator()
Getter for the field
publicationComparator.- Returns:
- a
Comparatorobject.
-
getSourceComparator
public Comparator<CvTerm> getSourceComparator()
Getter for the field
sourceComparator.- 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.- Specified by:
comparein interfaceComparator<Publication>- Parameters:
publication1- aPublicationobject.publication2- aPublicationobject.- Returns:
- a int.
-
-