Class UnambiguousOrganismComparator

  • All Implemented Interfaces:
    Comparator<Organism>

    public class UnambiguousOrganismComparator
    extends OrganismComparator
    Unambiguous organism comparator. It will first look at the taxids. If taxIds are the same , it will look at the cell types using UnambiguousOrganismComparator. If the cell types are the same, it will look at the tissues using UnambiguousOrganismComparator. If the tissues are the same, it will look at the compartments using UnambiguousOrganismComparator. - 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

      • UnambiguousOrganismComparator

        public UnambiguousOrganismComparator()
        Creates a new UnambiguousOrganismComparator. It will use a UnambiguousCvTermComparator to compare tissues, cell types 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. It will first look at the taxids. If taxIds are the same , it will look at the cell types using UnambiguousOrganismComparator. If the cell types are the same, it will look at the tissues using UnambiguousOrganismComparator. If the tissues are the same, it will look at the compartments using UnambiguousOrganismComparator. - 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 OrganismComparator
        Parameters:
        organism1 - a Organism object.
        organism2 - a Organism object.
        Returns:
        a int.
      • areEquals

        public static boolean areEquals​(Organism organism1,
                                        Organism organism2)
        Use UnambiguousOrganismComparator to know if two organism are equals.
      • hashCode

        public static int hashCode​(Organism organism)