Class UnambiguousExactEntityBaseComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.participant.EntityBaseComparator
-
- psidev.psi.mi.jami.utils.comparator.participant.UnambiguousExactEntityBaseComparator
-
- All Implemented Interfaces:
Comparator<Entity>
public class UnambiguousExactEntityBaseComparator extends EntityBaseComparator
Unambiguous exact entity comparator It will first compare the interactors using UnambiguousExactInteractorComparator. If both interactors are the same, it will look at the stoichiometry (participant with lower stoichiometry will come first).This comparator will ignore all the other properties of a participant.
- Since:
18/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description UnambiguousExactEntityBaseComparator()
UnambiguousExactEntityBaseComparator(UnambiguousExactInteractorComparator comparator)
Constructor for UnambiguousExactEntityBaseComparator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(Entity participant1, Entity participant2)
Use UnambiguousExactParticipantBaseComparator to know if two participants are equals.int
compare(Entity participant1, Entity participant2)
It will first compare the interactors using UnambiguousExactInteractorComparator.UnambiguousExactInteractorComparator
getInteractorComparator()
Getter for the fieldinteractorComparator
.static int
hashCode(Entity participant)
-
Methods inherited from class psidev.psi.mi.jami.utils.comparator.participant.EntityBaseComparator
getStoichiometryComparator, isIgnoreInteractors, isIgnoreStoichiometry, setIgnoreInteractors, 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
-
UnambiguousExactEntityBaseComparator
public UnambiguousExactEntityBaseComparator()
Creates a new UnambiguousExactParticipantBaseComparator. It will use a UnambiguousExactInteractorComparator to compare interactors, a UnambiguousCvTermComparator to compare biological roles.
-
UnambiguousExactEntityBaseComparator
public UnambiguousExactEntityBaseComparator(UnambiguousExactInteractorComparator comparator)
Constructor for UnambiguousExactEntityBaseComparator.
- Parameters:
comparator
- aUnambiguousExactInteractorComparator
object.
-
-
Method Detail
-
areEquals
public static boolean areEquals(Entity participant1, Entity participant2)
Use UnambiguousExactParticipantBaseComparator to know if two participants are equals.
-
hashCode
public static int hashCode(Entity participant)
hashCode
- Parameters:
participant
- aEntity
object.- Returns:
- the hashcode consistent with the equals method for this comparator
-
getInteractorComparator
public UnambiguousExactInteractorComparator getInteractorComparator()
Description copied from class:EntityBaseComparator
Getter for the field
interactorComparator
.- Overrides:
getInteractorComparator
in classEntityBaseComparator
- Returns:
- a
InteractorComparator
object.
-
compare
public int compare(Entity participant1, Entity participant2)
It will first compare the interactors using UnambiguousExactInteractorComparator. If both interactors are the same, it will look at the stoichiometry (participant with lower stoichiometry will come first).- Specified by:
compare
in interfaceComparator<Entity>
- Overrides:
compare
in classEntityBaseComparator
- Parameters:
participant1
- aEntity
object.participant2
- aEntity
object.- Returns:
- a int.
-
-