Class ParameterValueComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.parameter.ParameterValueComparator
-
- All Implemented Interfaces:
Comparator<ParameterValue>
public class ParameterValueComparator extends Object implements Comparator<ParameterValue>
Comparator for ParameterValue. It compares the BigDecimal value of factor.multiply(BigDecimal.valueOf(base^exponent)) If both values are null, they are equals. The value that is not null comes before the one that is null.- Since:
19/12/12
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description ParameterValueComparator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(ParameterValue value1, ParameterValue value2)
Use ParameterValueComparator to know if two ParameterValue are equals.int
compare(ParameterValue value1, ParameterValue value2)
It compares the BigDecimal value of factor.multiply(BigDecimal.valueOf(base^exponent)) If both values are null, they are equals.static int
hashCode(ParameterValue param)
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(ParameterValue value1, ParameterValue value2)
It compares the BigDecimal value of factor.multiply(BigDecimal.valueOf(base^exponent)) If both values are null, they are equals. The value that is not null comes before the one that is null.- Specified by:
compare
in interfaceComparator<ParameterValue>
- Parameters:
value1
- aParameterValue
object.value2
- aParameterValue
object.- Returns:
- a int.
-
areEquals
public static boolean areEquals(ParameterValue value1, ParameterValue value2)
Use ParameterValueComparator to know if two ParameterValue are equals.- Parameters:
value1
- aParameterValue
object.value2
- aParameterValue
object.- Returns:
- true if the two parameter values are equal
-
hashCode
public static int hashCode(ParameterValue param)
hashCode
- Parameters:
param
- aParameterValue
object.- Returns:
- the hashcode consistent with the equals method for this comparator
-
-