Class OrganismTaxIdComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.organism.OrganismTaxIdComparator
-
- All Implemented Interfaces:
Comparator<Organism>
- Direct Known Subclasses:
OrganismComparator
public class OrganismTaxIdComparator extends Object implements Comparator<Organism>
Simple organism comparator based on the taxIds. - Two organisms which are null are equals - The organism which is not null is before null.- Since:
21/12/12
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description OrganismTaxIdComparator()
Creates a new OrganismComparator
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(Organism organism1, Organism organism2)
Use OrganismTaxIdComparator to know if two organisms are equals.int
compare(Organism organism1, Organism organism2)
Comparison is based on taxIds only.static int
hashCode(Organism organism)
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
-
-
-
-
Method Detail
-
compare
public int compare(Organism organism1, Organism organism2)
Comparison is based on taxIds only. - Two organisms which are null are equals - The organism which is not null is before null.- Specified by:
compare
in interfaceComparator<Organism>
- Parameters:
organism1
- aOrganism
object.organism2
- aOrganism
object.- Returns:
- a int.
-
areEquals
public static boolean areEquals(Organism organism1, Organism organism2)
Use OrganismTaxIdComparator to know if two organisms are equals.
-
-