Class 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)
    • Method Detail

      • getCvTermComparator

        public Comparator<CvTerm> getCvTermComparator()

        Getter for the field cvTermComparator.

        Returns:
        a Comparator 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 interface Comparator<Interaction>
        Parameters:
        interaction1 - a Interaction object.
        interaction2 - a Interaction object.
        Returns:
        a int.