Class UnambiguousInteractionBaseComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.interaction.InteractionBaseComparator
-
- psidev.psi.mi.jami.utils.comparator.interaction.UnambiguousInteractionBaseComparator
-
- All Implemented Interfaces:
Comparator<Interaction>
public class UnambiguousInteractionBaseComparator extends InteractionBaseComparator
Unambiguous Interaction comparator. It will first compare the interaction types using UnambiguousCvTermComparator. Then it will compare the rigids (case sensitive, null rigids always come after). Then it will compare the identifiers using UnambiguousExternalIdentifierComparator. If the interactions do not have any identifiers, it will compare the shortnames (case sensitive, shortname null comes always after)- Since:
18/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description UnambiguousInteractionBaseComparator()
Creates a new UnambiguousInteractionBaseComparator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(Interaction interaction1, Interaction interaction2)
Use UnambiguousInteractionBaseComparator to know if two interactions are equals.UnambiguousCvTermComparator
getCvTermComparator()
getCvTermComparatorUnambiguousExternalIdentifierComparator
getIdentifierComparator()
getIdentifierComparatorstatic int
hashCode(Interaction interaction)
hashCode-
Methods inherited from class psidev.psi.mi.jami.utils.comparator.interaction.InteractionBaseComparator
compare, getIdentifierCollectionComparator
-
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()
getCvTermComparator
- Overrides:
getCvTermComparator
in classInteractionBaseComparator
- Returns:
- a
UnambiguousCvTermComparator
object.
-
getIdentifierComparator
public UnambiguousExternalIdentifierComparator getIdentifierComparator()
getIdentifierComparator
- Overrides:
getIdentifierComparator
in classInteractionBaseComparator
- Returns:
- a
UnambiguousExternalIdentifierComparator
object.
-
areEquals
public static boolean areEquals(Interaction interaction1, Interaction interaction2)
Use UnambiguousInteractionBaseComparator to know if two interactions are equals.- Parameters:
interaction1
- aInteraction
object.interaction2
- aInteraction
object.- Returns:
- true if the two interactions are equal
-
hashCode
public static int hashCode(Interaction interaction)
hashCode
- Parameters:
interaction
- aInteraction
object.- Returns:
- the hashcode consistent with the equals method for this comparator
-
-