Class ParticipantBaseComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.participant.ParticipantBaseComparator
-
- All Implemented Interfaces:
Comparator<Participant>
- Direct Known Subclasses:
UnambiguousExactParticipantBaseComparator
,UnambiguousParticipantBaseComparator
public class ParticipantBaseComparator extends Object implements Comparator<Participant>
Basic participant comparator. It will first compare the interactors/stoichiometry/features using EntityBaseComparator. If both interactors are the same, it will compare the biological roles using AbstractCvTermComparator.This comparator will ignore all the other properties of a participant.
- Since:
16/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description ParticipantBaseComparator(EntityBaseComparator interactorComparator, Comparator<CvTerm> cvTermComparator)
Creates a new ParticipantBaseComparator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Participant participant1, Participant participant2)
It will first compare the interactors using InteractorComparator.Comparator<CvTerm>
getCvTermComparator()
Getter for the fieldcvTermComparator
.EntityBaseComparator
getEntityBaseComparator()
getEntityBaseComparatorboolean
isIgnoreInteractors()
isIgnoreInteractorsboolean
isIgnoreStoichiometry()
isIgnoreStoichiometryvoid
setIgnoreInteractors(boolean ignoreInteractors)
setIgnoreInteractorsvoid
setIgnoreStoichiometry(boolean ignoreStoichiometry)
setIgnoreStoichiometry-
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
-
ParticipantBaseComparator
public ParticipantBaseComparator(EntityBaseComparator interactorComparator, Comparator<CvTerm> cvTermComparator)
Creates a new ParticipantBaseComparator- Parameters:
interactorComparator
- : interactor comparator required for comparing the moleculescvTermComparator
- : CvTerm comparator required for comparing biological roles
-
-
Method Detail
-
getCvTermComparator
public Comparator<CvTerm> getCvTermComparator()
Getter for the field
cvTermComparator
.- Returns:
- a
Comparator
object.
-
getEntityBaseComparator
public EntityBaseComparator getEntityBaseComparator()
getEntityBaseComparator
- Returns:
- a
EntityBaseComparator
object.
-
isIgnoreInteractors
public boolean isIgnoreInteractors()
isIgnoreInteractors
- Returns:
- a boolean.
-
setIgnoreInteractors
public void setIgnoreInteractors(boolean ignoreInteractors)
setIgnoreInteractors
- Parameters:
ignoreInteractors
- a boolean.
-
isIgnoreStoichiometry
public boolean isIgnoreStoichiometry()
isIgnoreStoichiometry
- Returns:
- a boolean.
-
setIgnoreStoichiometry
public void setIgnoreStoichiometry(boolean ignoreStoichiometry)
setIgnoreStoichiometry
- Parameters:
ignoreStoichiometry
- a boolean.
-
compare
public int compare(Participant participant1, Participant participant2)
It will first compare the interactors using InteractorComparator. If both interactors are the same, it will compare the biological roles using AbstractCvTermComparator. If both biological roles are the same, it will look at the stoichiometry (participant with lower stoichiometry will come first). If the stoichiometry is the same for both participants, it will compare the features using aComparator
of typeFeature
.This comparator will ignore all the other properties of a participant.
- Specified by:
compare
in interfaceComparator<Participant>
- Parameters:
participant1
- aParticipant
object.participant2
- aParticipant
object.- Returns:
- a int.
-
-