Package net.sf.saxon.expr.sort
Class SimpleTypeIdentityComparison
- java.lang.Object
-
- net.sf.saxon.expr.sort.SimpleTypeComparison
-
- net.sf.saxon.expr.sort.SimpleTypeIdentityComparison
-
- All Implemented Interfaces:
EqualityMatcher<AtomicSequence>
public class SimpleTypeIdentityComparison extends SimpleTypeComparison
This class implements equality and identity comparisons between values of simple types: that is, atomic values, and sequences of atomic values, following the XSD-defined rules for equality and identity comparisons. These are not always the same as the XPath-defined rules. In particular, under XSD rules values are generally only comparable with others of the same primitive type: a double and a float, for example, never compare equal.In practice, identity comparison delivers the same result as equality comparison in all cases except NaN: NaN is identical to itself but not equal to itself.
This class is a singleton that cannot be externally instantiated.
-
-
Constructor Summary
Constructors Constructor Description SimpleTypeIdentityComparison()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equal(AtomicSequence a, AtomicSequence b)
Test whether two values are equal or identical under XSD rules.static SimpleTypeIdentityComparison
getInstance()
Get the singleton instance of this class-
Methods inherited from class net.sf.saxon.expr.sort.SimpleTypeComparison
compareItems, compareSequences, equalOrIdentical, hash
-
-
-
-
Method Detail
-
getInstance
public static SimpleTypeIdentityComparison getInstance()
Get the singleton instance of this class- Returns:
- the singleton instance
-
equal
public boolean equal(AtomicSequence a, AtomicSequence b)
Test whether two values are equal or identical under XSD rules.- Specified by:
equal
in interfaceEqualityMatcher<AtomicSequence>
- Overrides:
equal
in classSimpleTypeComparison
- Parameters:
a
- the first valueb
- the second value- Returns:
- true if the two values are equal under XSD rules, or if they are identical under XSD rules; false in all other cases.
-
-