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 aComparatorof 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 intcompare(Entity participant1, Entity participant2)It will first compare the interactors using InteractorComparator.InteractorComparatorgetInteractorComparator()Getter for the fieldinteractorComparator.StoichiometryComparatorgetStoichiometryComparator()Getter for the fieldstoichiometryComparator.booleanisIgnoreInteractors()isIgnoreInteractorsbooleanisIgnoreStoichiometry()isIgnoreStoichiometryvoidsetIgnoreInteractors(boolean ignoreInteractors)Setter for the fieldignoreInteractors.voidsetIgnoreStoichiometry(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
StoichiometryComparatorobject.
-
getInteractorComparator
public InteractorComparator getInteractorComparator()
Getter for the field
interactorComparator.- Returns:
- a
InteractorComparatorobject.
-
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 aComparatorof typeFeature.This comparator will ignore all the other properties of a participant.
- Specified by:
comparein interfaceComparator<Entity>- Parameters:
participant1- aEntityobject.participant2- aEntityobject.- Returns:
- a int.
-
-