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