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 aComparator
of 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 int
compare(Experiment experiment1, Experiment experiment2)
It will look first at the publications using a AbstractPublicationComparator.Comparator<CvTerm>
getCvTermComparator()
Getter for the fieldcvTermComparator
.OrganismComparator
getOrganismComparator()
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 aComparator
of typePublication
to 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
- aComparator
object.organismComparator
- aOrganismComparator
object.variableParameter
- aCollectionComparator
object.
-
-
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:
compare
in interfaceComparator<Experiment>
- Parameters:
experiment1
- aExperiment
object.experiment2
- aExperiment
object.- Returns:
- a int.
-
getCvTermComparator
public Comparator<CvTerm> getCvTermComparator()
Getter for the field
cvTermComparator
.- Returns:
- a
Comparator
object.
-
getPublicationComparator
public Comparator<Publication> getPublicationComparator()
Getter for the field
publicationComparator
.- Returns:
- a
Comparator
object.
-
getOrganismComparator
public OrganismComparator getOrganismComparator()
Getter for the field
organismComparator
.- Returns:
- a
OrganismComparator
object.
-
getVariableParameterCollectionComparator
public CollectionComparator<VariableParameter> getVariableParameterCollectionComparator()
Getter for the field
variableParameterCollectionComparator
.- Returns:
- a
CollectionComparator
object.
-
-