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 intcompare(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- aComparatorobject.cvTermComparator- aComparatorobject.
-
InteractionBaseComparator
public InteractionBaseComparator(CollectionComparator<Xref> identifierComparator, Comparator<CvTerm> cvTermComparator)
Constructor for InteractionBaseComparator.
- Parameters:
identifierComparator- aCollectionComparatorobject.cvTermComparator- aComparatorobject.
-
-
Method Detail
-
getCvTermComparator
public Comparator<CvTerm> getCvTermComparator()
Getter for the field
cvTermComparator.- Returns:
- a
Comparatorobject.
-
getIdentifierCollectionComparator
public CollectionComparator<Xref> getIdentifierCollectionComparator()
Getter for the field
identifierCollectionComparator.- Returns:
- a
CollectionComparatorobject.
-
getIdentifierComparator
public Comparator<Xref> getIdentifierComparator()
Getter for the field
identifierComparator.- Returns:
- a
Comparatorobject.
-
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:
comparein interfaceComparator<Interaction>- Parameters:
interaction1- aInteractionobject.interaction2- aInteractionobject.- Returns:
- a int.
-
-