Class UnambiguousOrganismComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.organism.OrganismTaxIdComparator
-
- psidev.psi.mi.jami.utils.comparator.organism.OrganismComparator
-
- psidev.psi.mi.jami.utils.comparator.organism.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 Summary
Constructors Constructor Description UnambiguousOrganismComparator()
Creates a new UnambiguousOrganismComparator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(Organism organism1, Organism organism2)
Use UnambiguousOrganismComparator to know if two organism are equals.int
compare(Organism organism1, Organism organism2)
It will first look at the taxids.UnambiguousCvTermComparator
getCvTermComparator()
static int
hashCode(Organism organism)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
getCvTermComparator
public UnambiguousCvTermComparator getCvTermComparator()
- Overrides:
getCvTermComparator
in classOrganismComparator
-
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 interfaceComparator<Organism>
- Overrides:
compare
in classOrganismComparator
- Parameters:
organism1
- aOrganism
object.organism2
- aOrganism
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)
-
-