Class ParameterComparator

  • All Implemented Interfaces:
    Comparator<Parameter>
    Direct Known Subclasses:
    UnambiguousParameterComparator

    public abstract class ParameterComparator
    extends Object
    implements Comparator<Parameter>
    Simple comparator for Parameter 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.
    Since:
    18/12/12
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • ParameterComparator

        public ParameterComparator​(Comparator<CvTerm> cvTermComparator)
        Creates a new ParameterComparator
        Parameters:
        cvTermComparator - : cv term comparator to compare parameter types and units. It is required
      • ParameterComparator

        public ParameterComparator​(Comparator<CvTerm> cvTermComparator,
                                   ParameterValueComparator valueComparator)
        Creates a new ParameterComparator
        Parameters:
        cvTermComparator - : cv term comparator to compare parameter types and units. It is required
        valueComparator - : parameter value comparator. If null, it will create a new ParameterValueComparator
    • Method Detail

      • getCvTermComparator

        public Comparator<CvTerm> getCvTermComparator()

        Getter for the field cvTermComparator.

        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.
        Specified by:
        compare in interface Comparator<Parameter>
        Parameters:
        parameter1 - a Parameter object.
        parameter2 - a Parameter object.
        Returns:
        a int.