Class EntityBaseComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.participant.EntityBaseComparator
-
- All Implemented Interfaces:
Comparator<Entity>
- Direct Known Subclasses:
UnambiguousEntityBaseComparator
,UnambiguousExactEntityBaseComparator
public class EntityBaseComparator extends Object implements Comparator<Entity>
Basic entity comparator. It will first compare the interactors using InteractorComparator. If both interactors 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.
- Since:
16/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description EntityBaseComparator(InteractorComparator interactorComparator)
Creates a new EntityBaseComparator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Entity participant1, Entity participant2)
It will first compare the interactors using InteractorComparator.InteractorComparator
getInteractorComparator()
Getter for the fieldinteractorComparator
.StoichiometryComparator
getStoichiometryComparator()
Getter for the fieldstoichiometryComparator
.boolean
isIgnoreInteractors()
isIgnoreInteractorsboolean
isIgnoreStoichiometry()
isIgnoreStoichiometryvoid
setIgnoreInteractors(boolean ignoreInteractors)
Setter for the fieldignoreInteractors
.void
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
-
EntityBaseComparator
public EntityBaseComparator(InteractorComparator interactorComparator)
Creates a new EntityBaseComparator- Parameters:
interactorComparator
- : interactor comparator required for comparing the molecules
-
-
Method Detail
-
getStoichiometryComparator
public StoichiometryComparator getStoichiometryComparator()
Getter for the field
stoichiometryComparator
.- Returns:
- a
StoichiometryComparator
object.
-
getInteractorComparator
public InteractorComparator getInteractorComparator()
Getter for the field
interactorComparator
.- Returns:
- a
InteractorComparator
object.
-
isIgnoreStoichiometry
public boolean isIgnoreStoichiometry()
isIgnoreStoichiometry
- Returns:
- a boolean.
-
setIgnoreStoichiometry
public void setIgnoreStoichiometry(boolean ignoreStoichiometry)
setIgnoreStoichiometry
- Parameters:
ignoreStoichiometry
- a boolean.
-
isIgnoreInteractors
public boolean isIgnoreInteractors()
isIgnoreInteractors
- Returns:
- a boolean.
-
setIgnoreInteractors
public void setIgnoreInteractors(boolean ignoreInteractors)
Setter for the field
ignoreInteractors
.- Parameters:
ignoreInteractors
- a boolean.
-
compare
public int compare(Entity participant1, Entity participant2)
It will first compare the interactors using InteractorComparator. If both interactors 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<Entity>
- Parameters:
participant1
- aEntity
object.participant2
- aEntity
object.- Returns:
- a int.
-
-