Class ExperimentComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.experiment.ExperimentComparator
-
- All Implemented Interfaces:
Comparator<Experiment>
- Direct Known Subclasses:
UnambiguousCuratedExperimentComparator,UnambiguousExperimentComparator
public class ExperimentComparator extends Object implements Comparator<Experiment>
Basic experiment comparator. It will look first at the publications using aComparatorof typePublication. If the publications are the same, it will look at the interaction detection methods using AbstractCvTermComparator. If the interaction detection methods are the same, it will look at the host organisms using OrganismComparator. If the host organisms are the same, it will look at the variableParameters using VariableParameterComparator. This comparator will ignore all the other properties of an experiment.- Since:
15/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description ExperimentComparator(Comparator<Publication> publicationComparator, OrganismComparator organismComparator)Creates a new ExperimentComparator.ExperimentComparator(Comparator<Publication> publicationComparator, OrganismComparator organismComparator, CollectionComparator<VariableParameter> variableParameter)Constructor for ExperimentComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Experiment experiment1, Experiment experiment2)It will look first at the publications using a AbstractPublicationComparator.Comparator<CvTerm>getCvTermComparator()Getter for the fieldcvTermComparator.OrganismComparatorgetOrganismComparator()Getter for the fieldorganismComparator.Comparator<Publication>getPublicationComparator()Getter for the fieldpublicationComparator.CollectionComparator<VariableParameter>getVariableParameterCollectionComparator()Getter for the fieldvariableParameterCollectionComparator.-
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
-
ExperimentComparator
public ExperimentComparator(Comparator<Publication> publicationComparator, OrganismComparator organismComparator)
Creates a new ExperimentComparator. It needs aComparatorof typePublicationto compare publications, a OrganismComparator to compare host organisms and a AbstractCvTermComparator to compare interaction detection methods.- Parameters:
publicationComparator- : comparator for the publication which is requiredorganismComparator- : comparator for the host organism which is required
-
ExperimentComparator
public ExperimentComparator(Comparator<Publication> publicationComparator, OrganismComparator organismComparator, CollectionComparator<VariableParameter> variableParameter)
Constructor for ExperimentComparator.
- Parameters:
publicationComparator- aComparatorobject.organismComparator- aOrganismComparatorobject.variableParameter- aCollectionComparatorobject.
-
-
Method Detail
-
compare
public int compare(Experiment experiment1, Experiment experiment2)
It will look first at the publications using a AbstractPublicationComparator. If the publications are the same, it will look at the interaction detection methods using AbstractCvTermComparator. If the interaction detection methods are the same, it will look at the host organisms using OrganismComparator. If the host organisms are the same, it will look at the variableParameters using VariableParameterComparator. This comparator will ignore all the other properties of an experiment.- Specified by:
comparein interfaceComparator<Experiment>- Parameters:
experiment1- aExperimentobject.experiment2- aExperimentobject.- Returns:
- a int.
-
getCvTermComparator
public Comparator<CvTerm> getCvTermComparator()
Getter for the field
cvTermComparator.- Returns:
- a
Comparatorobject.
-
getPublicationComparator
public Comparator<Publication> getPublicationComparator()
Getter for the field
publicationComparator.- Returns:
- a
Comparatorobject.
-
getOrganismComparator
public OrganismComparator getOrganismComparator()
Getter for the field
organismComparator.- Returns:
- a
OrganismComparatorobject.
-
getVariableParameterCollectionComparator
public CollectionComparator<VariableParameter> getVariableParameterCollectionComparator()
Getter for the field
variableParameterCollectionComparator.- Returns:
- a
CollectionComparatorobject.
-
-