Class UnambiguousCausalRelationshipComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.participant.CausalRelationshipComparator
-
- psidev.psi.mi.jami.utils.comparator.participant.UnambiguousCausalRelationshipComparator
-
- All Implemented Interfaces:
Comparator<CausalRelationship>
public class UnambiguousCausalRelationshipComparator extends CausalRelationshipComparator
Unambiguous comparator for CausalRelationship It will first compare the relationType using UnambiguousCvTermComparator. If both relationTypes are identical, it will compare the target using UnambiguousEntityComparator- Since:
22/05/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description UnambiguousCausalRelationshipComparator()
Creates a new UnambiguousCausalRelationshipComparator with DefaultCvTermComparator and DefaultExactParticipantBaseComparator
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(CausalRelationship rel1, CausalRelationship rel2)
Use UnambiguousCausalRelationshipComparator to know if two causalRelationShip are equals.int
compare(CausalRelationship rel1, CausalRelationship rel2)
It will first compare the relationType using UnambiguousCvTermComparator.UnambiguousCvTermComparator
getCvTermComparator()
Getter for the fieldcvTermComparator
.UnambiguousEntityComparator
getParticipantComparator()
Getter for the fieldparticipantComparator
.static int
hashCode(CausalRelationship rel)
hashCode-
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
-
-
-
-
Method Detail
-
getCvTermComparator
public UnambiguousCvTermComparator getCvTermComparator()
Getter for the field
cvTermComparator
.- Overrides:
getCvTermComparator
in classCausalRelationshipComparator
- Returns:
- a
Comparator
object.
-
getParticipantComparator
public UnambiguousEntityComparator getParticipantComparator()
Description copied from class:CausalRelationshipComparator
Getter for the field
participantComparator
.- Overrides:
getParticipantComparator
in classCausalRelationshipComparator
- Returns:
- a
EntityComparator
object.
-
compare
public int compare(CausalRelationship rel1, CausalRelationship rel2)
It will first compare the relationType using UnambiguousCvTermComparator. If both relationTypes are identical, it will compare the target using UnambiguousParticipantBaseComparator- Specified by:
compare
in interfaceComparator<CausalRelationship>
- Overrides:
compare
in classCausalRelationshipComparator
- Parameters:
rel1
- : first causal relationshiprel2
- : second causal relationship- Returns:
- the comparison value
-
areEquals
public static boolean areEquals(CausalRelationship rel1, CausalRelationship rel2)
Use UnambiguousCausalRelationshipComparator to know if two causalRelationShip are equals.- Parameters:
rel1
- aCausalRelationship
object.rel2
- aCausalRelationship
object.- Returns:
- true if the two causalRelationShip are equal
-
hashCode
public static int hashCode(CausalRelationship rel)
hashCode
- Parameters:
rel
- aCausalRelationship
object.- Returns:
- the hashcode consistent with the equals method for this comparator
-
-