Class InteractionBaseComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.interaction.InteractionBaseComparator
-
- All Implemented Interfaces:
Comparator<Interaction>
- Direct Known Subclasses:
UnambiguousInteractionBaseComparator
public class InteractionBaseComparator extends Object implements Comparator<Interaction>
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 InteractionBaseComparator(Comparator<Xref> identifierComparator, Comparator<CvTerm> cvTermComparator)
Constructor for InteractionBaseComparator.InteractionBaseComparator(CollectionComparator<Xref> identifierComparator, Comparator<CvTerm> cvTermComparator)
Constructor for InteractionBaseComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Interaction interaction1, Interaction interaction2)
It will first compare the interaction types using UnambiguousCvTermComparator.Comparator<CvTerm>
getCvTermComparator()
Getter for the fieldcvTermComparator
.CollectionComparator<Xref>
getIdentifierCollectionComparator()
Getter for the fieldidentifierCollectionComparator
.Comparator<Xref>
getIdentifierComparator()
Getter for the fieldidentifierComparator
.-
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
-
InteractionBaseComparator
public InteractionBaseComparator(Comparator<Xref> identifierComparator, Comparator<CvTerm> cvTermComparator)
Constructor for InteractionBaseComparator.
- Parameters:
identifierComparator
- aComparator
object.cvTermComparator
- aComparator
object.
-
InteractionBaseComparator
public InteractionBaseComparator(CollectionComparator<Xref> identifierComparator, Comparator<CvTerm> cvTermComparator)
Constructor for InteractionBaseComparator.
- Parameters:
identifierComparator
- aCollectionComparator
object.cvTermComparator
- aComparator
object.
-
-
Method Detail
-
getCvTermComparator
public Comparator<CvTerm> getCvTermComparator()
Getter for the field
cvTermComparator
.- Returns:
- a
Comparator
object.
-
getIdentifierCollectionComparator
public CollectionComparator<Xref> getIdentifierCollectionComparator()
Getter for the field
identifierCollectionComparator
.- Returns:
- a
CollectionComparator
object.
-
getIdentifierComparator
public Comparator<Xref> getIdentifierComparator()
Getter for the field
identifierComparator
.- Returns:
- a
Comparator
object.
-
compare
public int compare(Interaction interaction1, Interaction interaction2)
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)- Specified by:
compare
in interfaceComparator<Interaction>
- Parameters:
interaction1
- aInteraction
object.interaction2
- aInteraction
object.- Returns:
- a int.
-
-