Class ExperimentComparator

  • All Implemented Interfaces:
    Comparator<Experiment>
    Direct Known Subclasses:
    UnambiguousCuratedExperimentComparator, UnambiguousExperimentComparator

    public class ExperimentComparator
    extends Object
    implements Comparator<Experiment>
    Basic experiment comparator. It will look first at the publications using a Comparator of type Publication. If the publications are the same, it will look at the interaction detection methods using AbstractCvTermComparator. If the interaction detection methods are the same, it will look at the host organisms using OrganismComparator. If the host organisms are the same, it will look at the variableParameters using VariableParameterComparator. This comparator will ignore all the other properties of an experiment.
    Since:
    15/01/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • ExperimentComparator

        public ExperimentComparator​(Comparator<Publication> publicationComparator,
                                    OrganismComparator organismComparator)
        Creates a new ExperimentComparator. It needs a Comparator of type Publication to compare publications, a OrganismComparator to compare host organisms and a AbstractCvTermComparator to compare interaction detection methods.
        Parameters:
        publicationComparator - : comparator for the publication which is required
        organismComparator - : comparator for the host organism which is required
    • Method Detail

      • compare

        public int compare​(Experiment experiment1,
                           Experiment experiment2)
        It will look first at the publications using a AbstractPublicationComparator. If the publications are the same, it will look at the interaction detection methods using AbstractCvTermComparator. If the interaction detection methods are the same, it will look at the host organisms using OrganismComparator. If the host organisms are the same, it will look at the variableParameters using VariableParameterComparator. This comparator will ignore all the other properties of an experiment.
        Specified by:
        compare in interface Comparator<Experiment>
        Parameters:
        experiment1 - a Experiment object.
        experiment2 - a Experiment object.
        Returns:
        a int.
      • getCvTermComparator

        public Comparator<CvTerm> getCvTermComparator()

        Getter for the field cvTermComparator.

        Returns:
        a Comparator object.
      • getPublicationComparator

        public Comparator<Publication> getPublicationComparator()

        Getter for the field publicationComparator.

        Returns:
        a Comparator object.