Class UnambiguousParameterComparator
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.parameter.ParameterComparator
-
- psidev.psi.mi.jami.utils.comparator.parameter.UnambiguousParameterComparator
-
- All Implemented Interfaces:
Comparator<Parameter>
public class UnambiguousParameterComparator extends ParameterComparator
Unambiguous parameter comparator. - Two parameters which are null are equals - The parameter which is not null is before null. - Use UnambiguousCvTermComparator to compare first the parameter types. - If parameter types are equals, use UnambiguousCvTermComparator to compare the units. - If the units are not set, compares the values - If both units are set and If they are equals, compares the values (case sensitive) - If both values are equals, compares the uncertainty.- Since:
19/12/12
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description UnambiguousParameterComparator()
Constructor for UnambiguousParameterComparator.UnambiguousParameterComparator(ParameterValueComparator valueComparator)
Constructor for UnambiguousParameterComparator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
areEquals(Parameter param1, Parameter param2)
Use UnabmbiguousComparatorParameter to know if two parameters are equals.int
compare(Parameter parameter1, Parameter parameter2)
It first compares parameter types, then parameter units and then it uses ParameterValueComparator for comparing parameter values It will also compare the uncertainty.UnambiguousCvTermComparator
getCvTermComparator()
Getter for the fieldcvTermComparator
.static int
hashCode(Parameter param)
hashCode-
Methods inherited from class psidev.psi.mi.jami.utils.comparator.parameter.ParameterComparator
getValueComparator
-
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
-
UnambiguousParameterComparator
public UnambiguousParameterComparator()
Constructor for UnambiguousParameterComparator.
-
UnambiguousParameterComparator
public UnambiguousParameterComparator(ParameterValueComparator valueComparator)
Constructor for UnambiguousParameterComparator.
- Parameters:
valueComparator
- aParameterValueComparator
object.
-
-
Method Detail
-
getCvTermComparator
public UnambiguousCvTermComparator getCvTermComparator()
Getter for the field
cvTermComparator
.- Overrides:
getCvTermComparator
in classParameterComparator
- Returns:
- a
Comparator
object.
-
compare
public int compare(Parameter parameter1, Parameter parameter2)
It first compares parameter types, then parameter units and then it uses ParameterValueComparator for comparing parameter values It will also compare the uncertainty. - Two parameters which are null are equals - The parameter which is not null is before null. - Use UnambiguousCvTermComparator to compare first the parameter types. - If parameter types are equals, use UnambiguousCvTermComparator to compare the units. - If the units are not set, compares the values - If both units are set and If they are equals, compares the values (case sensitive) - If both values are equals, compares the uncertainty.- Specified by:
compare
in interfaceComparator<Parameter>
- Overrides:
compare
in classParameterComparator
- Parameters:
parameter1
- aParameter
object.parameter2
- aParameter
object.- Returns:
- a int.
-
areEquals
public static boolean areEquals(Parameter param1, Parameter param2)
Use UnabmbiguousComparatorParameter to know if two parameters are equals.
-
-