Class UnambiguousExactCausalRelationshipComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.participant.CausalRelationshipComparator
-
- psidev.psi.mi.jami.utils.comparator.participant.UnambiguousExactCausalRelationshipComparator
-
- All Implemented Interfaces:
Comparator<CausalRelationship>
public class UnambiguousExactCausalRelationshipComparator extends CausalRelationshipComparator
Unambiguous exact comparator for CausalRelationship It will first compare the relationType using UnambiguousCvTermComparator. If both relationTypes are identical, it will compare the target using UnambiguousExactEntityComparator- Since:
22/05/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description UnambiguousExactCausalRelationshipComparator()
Creates a new UnambiguousExactCausalRelationshipComparator 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 UnambiguousExactCausalRelationshipComparator 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
.UnambiguousExactEntityComparator
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 UnambiguousExactEntityComparator 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 UnambiguousExactParticipantBaseComparator- 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 UnambiguousExactCausalRelationshipComparator 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
-
-