Class CausalRelationshipComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.participant.CausalRelationshipComparator
-
- All Implemented Interfaces:
Comparator<CausalRelationship>
- Direct Known Subclasses:
UnambiguousCausalRelationshipComparator,UnambiguousExactCausalRelationshipComparator
public class CausalRelationshipComparator extends Object implements Comparator<CausalRelationship>
Basic comparator for CausalRelationship It will first compare the relationType using AbstractCvTermComparator. If both relationTypes are identical, it will compare the target using ParticipantBaseComparator- Since:
22/05/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description CausalRelationshipComparator(Comparator<CvTerm> cvTermComparator, EntityComparator participantComparator)Constructor for CausalRelationshipComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(CausalRelationship causalRelationship1, CausalRelationship causalRelationship2)It will first compare the relationType using AbstractCvTermComparator.Comparator<CvTerm>getCvTermComparator()Getter for the fieldcvTermComparator.EntityComparatorgetParticipantComparator()Getter for the fieldparticipantComparator.-
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
-
CausalRelationshipComparator
public CausalRelationshipComparator(Comparator<CvTerm> cvTermComparator, EntityComparator participantComparator)
Constructor for CausalRelationshipComparator.
- Parameters:
cvTermComparator- aComparatorobject.participantComparator- aEntityComparatorobject.
-
-
Method Detail
-
getCvTermComparator
public Comparator<CvTerm> getCvTermComparator()
Getter for the field
cvTermComparator.- Returns:
- a
Comparatorobject.
-
getParticipantComparator
public EntityComparator getParticipantComparator()
Getter for the field
participantComparator.- Returns:
- a
EntityComparatorobject.
-
compare
public int compare(CausalRelationship causalRelationship1, CausalRelationship causalRelationship2)
It will first compare the relationType using AbstractCvTermComparator. If both relationTypes are identical, it will compare the target using ParticipantBaseComparator- Specified by:
comparein interfaceComparator<CausalRelationship>- Parameters:
causalRelationship1- : first causal relationshipcausalRelationship2- : second causal relationship- Returns:
- the comparison value
-
-