Class UnambiguousEntityBaseComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.participant.EntityBaseComparator
-
- psidev.psi.mi.jami.utils.comparator.participant.UnambiguousEntityBaseComparator
-
- All Implemented Interfaces:
Comparator<Entity>
public class UnambiguousEntityBaseComparator extends EntityBaseComparator
Unambiguous entity comparator It will first compare the interactors using UnambiguousInteractorComparator. 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:
16/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description UnambiguousEntityBaseComparator()
UnambiguousEntityBaseComparator(UnambiguousInteractorComparator comparator)
Constructor for UnambiguousEntityBaseComparator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(Entity participant1, Entity participant2)
Use UnambiguousParticipantBaseComparator to know if two participants are equals.int
compare(Entity participant1, Entity participant2)
It will first compare the interactors using UnambiguousInteractorComparator.UnambiguousInteractorComparator
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
-
UnambiguousEntityBaseComparator
public UnambiguousEntityBaseComparator()
Creates a new UnambiguousEntityBaseComparator. It will use a UnambiguousInteractorComparator to compare interactors
-
UnambiguousEntityBaseComparator
public UnambiguousEntityBaseComparator(UnambiguousInteractorComparator comparator)
Constructor for UnambiguousEntityBaseComparator.
- Parameters:
comparator
- aUnambiguousInteractorComparator
object.
-
-
Method Detail
-
areEquals
public static boolean areEquals(Entity participant1, Entity participant2)
Use UnambiguousParticipantBaseComparator 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 UnambiguousInteractorComparator 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 UnambiguousInteractorComparator. 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.- Specified by:
compare
in interfaceComparator<Entity>
- Overrides:
compare
in classEntityBaseComparator
- Parameters:
participant1
- aEntity
object.participant2
- aEntity
object.- Returns:
- a int.
-
-