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 booleanareEquals(Stoichiometry stc1, Stoichiometry stc2)Use StoichiometryComparator to know if two stoichiometry are equals.intcompare(Stoichiometry stoichiometry1, Stoichiometry stoichiometry2)It will first compare the minValue.static inthashCode(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:
comparein interfaceComparator<Stoichiometry>- Parameters:
stoichiometry1- aStoichiometryobject.stoichiometry2- aStoichiometryobject.- Returns:
- a int.
-
areEquals
public static boolean areEquals(Stoichiometry stc1, Stoichiometry stc2)
Use StoichiometryComparator to know if two stoichiometry are equals.- Parameters:
stc1- aStoichiometryobject.stc2- aStoichiometryobject.- Returns:
- true if the two stoichiometry are equal
-
hashCode
public static int hashCode(Stoichiometry stc)
hashCode
- Parameters:
stc- aStoichiometryobject.- Returns:
- the hashcode consistent with the equals method for this comparator
-
-