Class UnambiguousExactParticipantBaseComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.participant.ParticipantBaseComparator
-
- psidev.psi.mi.jami.utils.comparator.participant.UnambiguousExactParticipantBaseComparator
-
- All Implemented Interfaces:
Comparator<Participant>
public class UnambiguousExactParticipantBaseComparator extends ParticipantBaseComparator
Unambiguous exact participant comparator It will first compare the interactors using UnambiguousExactEntityBaseComparator. If both interactors are the same, it will compare the biological roles using UnambiguousCvTermComparator.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 UnambiguousExactParticipantBaseComparator()
UnambiguousExactParticipantBaseComparator(UnambiguousExactEntityBaseComparator comparator)
Constructor for UnambiguousExactParticipantBaseComparator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(Participant participant1, Participant participant2)
Use UnambiguousExactParticipantBaseComparator to know if two participants are equals.int
compare(Participant participant1, Participant participant2)
It will first compare the interactors using UnambiguousExactEntityBaseComparator.UnambiguousCvTermComparator
getCvTermComparator()
Getter for the fieldcvTermComparator
.UnambiguousExactEntityBaseComparator
getEntityBaseComparator()
getEntityBaseComparatorstatic int
hashCode(Participant participant)
hashCode-
Methods inherited from class psidev.psi.mi.jami.utils.comparator.participant.ParticipantBaseComparator
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
-
UnambiguousExactParticipantBaseComparator
public UnambiguousExactParticipantBaseComparator()
Creates a new UnambiguousExactParticipantBaseComparator. It will use a UnambiguousExactInteractorComparator to compare interactors, a UnambiguousCvTermComparator to compare biological roles.
-
UnambiguousExactParticipantBaseComparator
public UnambiguousExactParticipantBaseComparator(UnambiguousExactEntityBaseComparator comparator)
Constructor for UnambiguousExactParticipantBaseComparator.
- Parameters:
comparator
- aUnambiguousExactEntityBaseComparator
object.
-
-
Method Detail
-
areEquals
public static boolean areEquals(Participant participant1, Participant participant2)
Use UnambiguousExactParticipantBaseComparator to know if two participants are equals.- Parameters:
participant1
- aParticipant
object.participant2
- aParticipant
object.- Returns:
- true if the two participants are equal
-
hashCode
public static int hashCode(Participant participant)
hashCode
- Parameters:
participant
- aParticipant
object.- Returns:
- the hashcode consistent with the equals method for this comparator
-
getEntityBaseComparator
public UnambiguousExactEntityBaseComparator getEntityBaseComparator()
getEntityBaseComparator
- Overrides:
getEntityBaseComparator
in classParticipantBaseComparator
- Returns:
- a
EntityBaseComparator
object.
-
getCvTermComparator
public UnambiguousCvTermComparator getCvTermComparator()
Description copied from class:ParticipantBaseComparator
Getter for the field
cvTermComparator
.- Overrides:
getCvTermComparator
in classParticipantBaseComparator
- Returns:
- a
Comparator
object.
-
compare
public int compare(Participant participant1, Participant participant2)
It will first compare the interactors using UnambiguousExactEntityBaseComparator. If both interactors are the same, it will compare the biological roles using UnambiguousCvTermComparator.- Specified by:
compare
in interfaceComparator<Participant>
- Overrides:
compare
in classParticipantBaseComparator
- Parameters:
participant1
- aParticipant
object.participant2
- aParticipant
object.- Returns:
- a int.
-
-