Class InteractionEvidenceComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.interaction.InteractionEvidenceComparator
-
- All Implemented Interfaces:
Comparator<InteractionEvidence>
- Direct Known Subclasses:
UnambiguousCuratedInteractionEvidenceComparator
,UnambiguousExactCuratedInteractionEvidenceComparator
,UnambiguousExactInteractionEvidenceComparator
,UnambiguousInteractionEvidenceComparator
public class InteractionEvidenceComparator extends Object implements Comparator<InteractionEvidence>
Basic InteractionEvidenceComparator. It will first compare the basic interaction properties usingComparator
of typeInteraction
. It will then compares the IMEx identifiers if both IMEx ids are set. If at least one IMEx id is not set, it will compare the negative properties. A negative interaction will come after a positive interaction. it will compare the experiment using ExperimentComparator. If the experiments are the same, it will compare the participants using ParticipantEvidenceComparator. Then it will compare the parameters using ParameterComparator. If the parameters are the same, it will first compare the experimental variableParameters using VariableParameterValueSetComparator and then it will compare the inferred boolean value (Inferred interactions will always come after).- Since:
18/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description InteractionEvidenceComparator(Comparator<ParticipantEvidence> participantComparator, Comparator<Interaction> interactionComparator, ExperimentComparator experimentComparator, ParameterComparator parameterComparator)
Creates a new InteractionEvidenceComparator.InteractionEvidenceComparator(CollectionComparator<ParticipantEvidence> participantComparator, Comparator<Interaction> interactionComparator, ExperimentComparator experimentComparator, CollectionComparator<Parameter> parameterComparator, CollectionComparator<VariableParameterValueSet> variableParameterValuesSetComparator)
Constructor for InteractionEvidenceComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(InteractionEvidence experimentalInteraction1, InteractionEvidence experimentalInteraction2)
It will first compare the basic interaction properties usingComparator
of typeInteraction
.ExperimentComparator
getExperimentComparator()
Getter for the fieldexperimentComparator
.Comparator<Interaction>
getInteractionBaseComparator()
getInteractionBaseComparatorCollectionComparator<Parameter>
getParameterCollectionComparator()
Getter for the fieldparameterCollectionComparator
.CollectionComparator<ParticipantEvidence>
getParticipantCollectionComparator()
Getter for the fieldparticipantCollectionComparator
.CollectionComparator<VariableParameterValueSet>
getVariableParameterValueSetCollectionComparator()
Getter for the fieldvariableParameterValueSetCollectionComparator
.-
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
-
InteractionEvidenceComparator
public InteractionEvidenceComparator(Comparator<ParticipantEvidence> participantComparator, Comparator<Interaction> interactionComparator, ExperimentComparator experimentComparator, ParameterComparator parameterComparator)
Creates a new InteractionEvidenceComparator.- Parameters:
interactionComparator
- : required to compare basic interaction propertiesexperimentComparator
- : required to compare experimentsparameterComparator
- : required to compare parametersparticipantComparator
- aComparator
object.
-
InteractionEvidenceComparator
public InteractionEvidenceComparator(CollectionComparator<ParticipantEvidence> participantComparator, Comparator<Interaction> interactionComparator, ExperimentComparator experimentComparator, CollectionComparator<Parameter> parameterComparator, CollectionComparator<VariableParameterValueSet> variableParameterValuesSetComparator)
Constructor for InteractionEvidenceComparator.
- Parameters:
participantComparator
- aCollectionComparator
object.interactionComparator
- aComparator
object.experimentComparator
- aExperimentComparator
object.parameterComparator
- aCollectionComparator
object.variableParameterValuesSetComparator
- aCollectionComparator
object.
-
-
Method Detail
-
getParameterCollectionComparator
public CollectionComparator<Parameter> getParameterCollectionComparator()
Getter for the field
parameterCollectionComparator
.- Returns:
- a
CollectionComparator
object.
-
getInteractionBaseComparator
public Comparator<Interaction> getInteractionBaseComparator()
getInteractionBaseComparator
- Returns:
- a
Comparator
object.
-
getExperimentComparator
public ExperimentComparator getExperimentComparator()
Getter for the field
experimentComparator
.- Returns:
- a
ExperimentComparator
object.
-
getParticipantCollectionComparator
public CollectionComparator<ParticipantEvidence> getParticipantCollectionComparator()
Getter for the field
participantCollectionComparator
.- Returns:
- a
CollectionComparator
object.
-
getVariableParameterValueSetCollectionComparator
public CollectionComparator<VariableParameterValueSet> getVariableParameterValueSetCollectionComparator()
Getter for the field
variableParameterValueSetCollectionComparator
.- Returns:
- a
CollectionComparator
object.
-
compare
public int compare(InteractionEvidence experimentalInteraction1, InteractionEvidence experimentalInteraction2)
It will first compare the basic interaction properties usingComparator
of typeInteraction
. It will then compares the IMEx identifiers if both IMEx ids are set. If at least one IMEx id is not set, it will compare the negative properties. A negative interaction will come after a positive interaction. it will compare the experiment using ExperimentComparator. If the experiments are the same, it will compare the participants using ParticipantEvidenceComparator. Then, it will compare the parameters using ParameterComparator. If the parameters are the same, it will first compare the experimental variableParameters using VariableParameterValueSetComparator and then it will compare the inferred boolean value (Inferred interactions will always come after).- Specified by:
compare
in interfaceComparator<InteractionEvidence>
- Parameters:
experimentalInteraction1
- aInteractionEvidence
object.experimentalInteraction2
- aInteractionEvidence
object.- Returns:
- a int.
-
-