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>
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 -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test whether two values are equal or identical under XSD rules.static SimpleTypeIdentityComparison
Get the singleton instance of this classMethods inherited from class net.sf.saxon.expr.sort.SimpleTypeComparison
compareItems, compareSequences, equalOrIdentical, hash
-
Constructor Details
-
SimpleTypeIdentityComparison
public SimpleTypeIdentityComparison()
-
-
Method Details
-
getInstance
Get the singleton instance of this class- Returns:
- the singleton instance
-
equal
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.
-