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 booleanareEquals(Entity participant1, Entity participant2)Use UnambiguousParticipantBaseComparator to know if two participants are equals.intcompare(Entity participant1, Entity participant2)It will first compare the interactors using UnambiguousInteractorComparator.UnambiguousInteractorComparatorgetInteractorComparator()Getter for the fieldinteractorComparator.static inthashCode(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- aUnambiguousInteractorComparatorobject.
-
-
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- aEntityobject.- Returns:
- the hashcode consistent with the equals method for this comparator
-
getInteractorComparator
public UnambiguousInteractorComparator getInteractorComparator()
Description copied from class:EntityBaseComparatorGetter for the field
interactorComparator.- Overrides:
getInteractorComparatorin classEntityBaseComparator- Returns:
- a
InteractorComparatorobject.
-
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:
comparein interfaceComparator<Entity>- Overrides:
comparein classEntityBaseComparator- Parameters:
participant1- aEntityobject.participant2- aEntityobject.- Returns:
- a int.
-
-