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 int
compare(CausalRelationship causalRelationship1, CausalRelationship causalRelationship2)
It will first compare the relationType using AbstractCvTermComparator.Comparator<CvTerm>
getCvTermComparator()
Getter for the fieldcvTermComparator
.EntityComparator
getParticipantComparator()
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
- aComparator
object.participantComparator
- aEntityComparator
object.
-
-
Method Detail
-
getCvTermComparator
public Comparator<CvTerm> getCvTermComparator()
Getter for the field
cvTermComparator
.- Returns:
- a
Comparator
object.
-
getParticipantComparator
public EntityComparator getParticipantComparator()
Getter for the field
participantComparator
.- Returns:
- a
EntityComparator
object.
-
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:
compare
in interfaceComparator<CausalRelationship>
- Parameters:
causalRelationship1
- : first causal relationshipcausalRelationship2
- : second causal relationship- Returns:
- the comparison value
-
-