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 booleanareEquals(Participant participant1, Participant participant2)Use UnambiguousExactParticipantBaseComparator to know if two participants are equals.intcompare(Participant participant1, Participant participant2)It will first compare the interactors using UnambiguousExactEntityBaseComparator.UnambiguousCvTermComparatorgetCvTermComparator()Getter for the fieldcvTermComparator.UnambiguousExactEntityBaseComparatorgetEntityBaseComparator()getEntityBaseComparatorstatic inthashCode(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- aUnambiguousExactEntityBaseComparatorobject.
-
-
Method Detail
-
areEquals
public static boolean areEquals(Participant participant1, Participant participant2)
Use UnambiguousExactParticipantBaseComparator to know if two participants are equals.- Parameters:
participant1- aParticipantobject.participant2- aParticipantobject.- Returns:
- true if the two participants are equal
-
hashCode
public static int hashCode(Participant participant)
hashCode
- Parameters:
participant- aParticipantobject.- Returns:
- the hashcode consistent with the equals method for this comparator
-
getEntityBaseComparator
public UnambiguousExactEntityBaseComparator getEntityBaseComparator()
getEntityBaseComparator
- Overrides:
getEntityBaseComparatorin classParticipantBaseComparator- Returns:
- a
EntityBaseComparatorobject.
-
getCvTermComparator
public UnambiguousCvTermComparator getCvTermComparator()
Description copied from class:ParticipantBaseComparatorGetter for the field
cvTermComparator.- Overrides:
getCvTermComparatorin classParticipantBaseComparator- Returns:
- a
Comparatorobject.
-
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:
comparein interfaceComparator<Participant>- Overrides:
comparein classParticipantBaseComparator- Parameters:
participant1- aParticipantobject.participant2- aParticipantobject.- Returns:
- a int.
-
-