Class OrganismComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.organism.OrganismTaxIdComparator
-
- psidev.psi.mi.jami.utils.comparator.organism.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 Summary
Constructors Constructor Description OrganismComparator(Comparator<CvTerm> cvTermComparator)
Creates a new OrganismComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Organism organism1, Organism organism2)
It will first look at the taxids.Comparator<CvTerm>
getCvTermComparator()
-
Methods inherited from class psidev.psi.mi.jami.utils.comparator.organism.OrganismTaxIdComparator
areEquals, hashCode
-
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
-
-
-
-
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
-
getCvTermComparator
public Comparator<CvTerm> getCvTermComparator()
-
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 interfaceComparator<Organism>
- Overrides:
compare
in classOrganismTaxIdComparator
- Parameters:
organism1
- aOrganism
object.organism2
- aOrganism
object.- Returns:
- a int.
-
-