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 booleanareEquals(Participant participant1, Participant participant2)Use UnambiguousParticipantBaseComparator to know if two participants are equals.intcompare(Participant participant1, Participant participant2)It will first compare the interactors and stoichiometry using UnambiguousEntityComparator.UnambiguousCvTermComparatorgetCvTermComparator()Getter for the fieldcvTermComparator.UnambiguousEntityBaseComparatorgetEntityBaseComparator()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
-
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- aUnambiguousEntityBaseComparatorobject.
-
-
Method Detail
-
areEquals
public static boolean areEquals(Participant participant1, Participant participant2)
Use UnambiguousParticipantBaseComparator 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 UnambiguousEntityBaseComparator 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 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:
comparein interfaceComparator<Participant>- Overrides:
comparein classParticipantBaseComparator- Parameters:
participant1- aParticipantobject.participant2- aParticipantobject.- Returns:
- a int.
-
-