java.io.Serializable
, AtomicComparer
NumericComparer11
public class NumericComparer extends java.lang.Object implements AtomicComparer, java.io.Serializable
Modifier and Type | Field | Description |
---|---|---|
protected StringToDouble |
converter |
Modifier | Constructor | Description |
---|---|---|
protected |
NumericComparer() |
Modifier and Type | Method | 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.java.lang.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.java.lang.ClassCastException
- if the objects are not comparablepublic ComparisonKey getComparisonKey(AtomicValue a)
getComparisonKey
in interface AtomicComparer