Class StoichiometryComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.participant.StoichiometryComparator
-
- All Implemented Interfaces:
Comparator<Stoichiometry>
public class StoichiometryComparator extends Object implements Comparator<Stoichiometry>
Simple stoichiometry comparator. It will first compare the minValue. If both minValues are the same, it will compare maxValues.- Since:
21/05/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description StoichiometryComparator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(Stoichiometry stc1, Stoichiometry stc2)
Use StoichiometryComparator to know if two stoichiometry are equals.int
compare(Stoichiometry stoichiometry1, Stoichiometry stoichiometry2)
It will first compare the minValue.static int
hashCode(Stoichiometry stc)
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(Stoichiometry stoichiometry1, Stoichiometry stoichiometry2)
It will first compare the minValue. If both minValues are the same, it will compare maxValues.- Specified by:
compare
in interfaceComparator<Stoichiometry>
- Parameters:
stoichiometry1
- aStoichiometry
object.stoichiometry2
- aStoichiometry
object.- Returns:
- a int.
-
areEquals
public static boolean areEquals(Stoichiometry stc1, Stoichiometry stc2)
Use StoichiometryComparator to know if two stoichiometry are equals.- Parameters:
stc1
- aStoichiometry
object.stc2
- aStoichiometry
object.- Returns:
- true if the two stoichiometry are equal
-
hashCode
public static int hashCode(Stoichiometry stc)
hashCode
- Parameters:
stc
- aStoichiometry
object.- Returns:
- the hashcode consistent with the equals method for this comparator
-
-