public class NumericComparer extends Object implements AtomicComparer, Serializable
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
|
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 comparableCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.