Class ExactInteractorBaseComparator

  • All Implemented Interfaces:
    Comparator<Interactor>
    Direct Known Subclasses:
    UnambiguousExactInteractorBaseComparator

    public class ExactInteractorBaseComparator
    extends Object
    implements Comparator<Interactor>
    Interactor base comparator. It will first compare the interactor types using UnambiguousCvTermComparator. If both types are equal, it will compare organisms using OrganismTaxIdComparator. If both organisms are equal, it will use a UnambiguousInteractorBaseComparator to compare basic Interactor properties.
    Since:
    17/01/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • ExactInteractorBaseComparator

        public ExactInteractorBaseComparator​(OrganismTaxIdComparator organismComparator,
                                             Comparator<CvTerm> typeComparator,
                                             InteractorBaseComparator interactorBaseComparator)
        Creates a new UnambiguousExactInteractorBaseComparator. It will use a UnambiguousInteractorBaseComparator to compare basic interactor properties, a OrganismTaxIdComparator to compare organisms and a UnambiguousCvTermComparator to compare checksum types and interactor types
        Parameters:
        organismComparator - a OrganismTaxIdComparator object.
        typeComparator - a Comparator object.
        interactorBaseComparator - a InteractorBaseComparator object.
    • Method Detail

      • getTypeComparator

        public Comparator<CvTerm> getTypeComparator()

        Getter for the field typeComparator.

        Returns:
        a Comparator object.
      • compare

        public int compare​(Interactor interactor1,
                           Interactor interactor2)
        It will first compare the interactor types using UnambiguousCvTermComparator. If both types are equal, it will compare organisms using OrganismTaxIdComparator. If both organisms are equal, it will use a UnambiguousInteractorBaseComparator to compare basic Interactor properties.
        Specified by:
        compare in interface Comparator<Interactor>
        Parameters:
        interactor1 - a Interactor object.
        interactor2 - a Interactor object.
        Returns:
        a int.