Class EquivalenceComparer

  • All Implemented Interfaces:

    public class EquivalenceComparer
    extends GenericAtomicComparer
    A comparer that compares atomic values for equality, with the properties: - non-comparable types compare false - NaN compares equal to NaN
    • Method Detail

      • comparesEqual

        public boolean comparesEqual​(AtomicValue a,
                                     AtomicValue b)
                              throws NoDynamicContextException
        Compare two AtomicValue objects for equality according to the rules for their data type. UntypedAtomic values are compared as if they were strings; if different semantics are wanted, the conversion must be done by the caller.
        Specified by:
        comparesEqual in interface AtomicComparer
        comparesEqual in class GenericAtomicComparer
        a - the first object to be compared. If it is a StringValue, the collator is used to compare the values, otherwise the value must implement the equals() method.
        b - the second object to be compared. This must be comparable with the first object: for example, if one is a string, they must both be strings.
        true if the values are equal, false if not
        java.lang.ClassCastException - if the objects are not comparable
        NoDynamicContextException - if no dynamic context has been supplied, and a dynamic context is needed (for example, because the comparison uses the implicit timezone)
      • save

        public java.lang.String save()
        Create a string representation of this AtomicComparer that can be saved in a compiled package and used to reconstitute the AtomicComparer when the package is reloaded
        Specified by:
        save in interface AtomicComparer
        save in class GenericAtomicComparer
        a string representation of the AtomicComparer