public class NumericComparer extends Object implements AtomicComparer
Modifier and Type | Field and Description |
---|---|
protected StringToDouble |
converter |
Modifier | Constructor and Description |
---|---|
protected |
NumericComparer() |
Modifier and Type | Method and Description |
---|---|
int |
compareAtomicValues(AtomicValue a,
AtomicValue b)
Compare two Items by converting them to numbers and comparing the numeric values.
|
boolean |
comparesEqual(AtomicValue a,
AtomicValue b)
Compare two AtomicValue objects for equality according to the rules for their data type.
|
StringCollator |
getCollator()
Get the collation used by this AtomicComparer if any
|
static NumericComparer |
getInstance() |
AtomicComparer |
provideContext(XPathContext context)
Supply the dynamic context in case this is needed for the comparison
|
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
|
protected StringToDouble converter
public static NumericComparer getInstance()
public StringCollator getCollator()
AtomicComparer
getCollator
in interface AtomicComparer
public AtomicComparer provideContext(XPathContext context)
provideContext
in interface AtomicComparer
context
- the dynamic evaluation contextpublic int compareAtomicValues(AtomicValue a, AtomicValue b)
compareAtomicValues
in interface AtomicComparer
a
- the first Item to be compared.b
- the second Item to be compared.ClassCastException
- if the objects are not Itemspublic boolean comparesEqual(AtomicValue a, AtomicValue b)
comparesEqual
in interface AtomicComparer
a
- the first object to be compared.b
- the second object to be compared.ClassCastException
- if the objects are not comparablepublic String save()
save
in interface AtomicComparer
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.