Class OrganismComparator

  • All Implemented Interfaces:
    Comparator<Organism>
    Direct Known Subclasses:
    UnambiguousOrganismComparator

    public class OrganismComparator
    extends OrganismTaxIdComparator
    Basic organism comparator. It will first look at the taxids. If taxIds are the same , it will look at the cell types. If the cell types are the same, it will look at the tissues. If the tissues are the same, it will look at the compartments. - Two organisms which are null are equals - The organism which is not null is before null.
    Since:
    15/01/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • OrganismComparator

        public OrganismComparator​(Comparator<CvTerm> cvTermComparator)
        Creates a new OrganismComparator. It needs a cvtermComparator for comparing the cell types, tissues and compartments
        Parameters:
        cvTermComparator - : cv term comparator is required for comparing cell types, tissues and compartments
    • Method Detail

      • compare

        public int compare​(Organism organism1,
                           Organism organism2)
        It will first look at the taxids. If taxIds are the same , it will look at the cell types. If the cell types are the same, it will look at the tissues. If the tissues are the same, it will look at the compartments. - Two organisms which are null are equals - The organism which is not null is before null.
        Specified by:
        compare in interface Comparator<Organism>
        Overrides:
        compare in class OrganismTaxIdComparator
        Parameters:
        organism1 - a Organism object.
        organism2 - a Organism object.
        Returns:
        a int.