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
|
ComparisonKey |
getComparisonKey(AtomicValue a)
Get a comparison key for an object.
|
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 comparablepublic ComparisonKey getComparisonKey(AtomicValue a)
getComparisonKey
in interface AtomicComparer
Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.