net.sf.saxon.sort
public class TextComparer extends Object implements AtomicComparer, Serializable
Constructor Summary | |
---|---|
TextComparer(AtomicComparer baseComparer) |
Method Summary | |
---|---|
int | compareAtomicValues(AtomicValue a, AtomicValue b)
Compare two Items by converting them to strings and comparing the string values. |
boolean | comparesEqual(AtomicValue a, AtomicValue b)
Compare two AtomicValue objects for equality according to the rules for their data type. |
AtomicComparer | getBaseComparer()
Get the underlying comparer (which doesn't do conversion to string) |
ComparisonKey | getComparisonKey(AtomicValue a)
Get a comparison key for an object. |
AtomicComparer | provideContext(XPathContext context)
Supply the dynamic context in case this is needed for the comparison |
Parameters: a the first Item to be compared. b the second Item to be compared.
Returns: <0 if a0 if a>b
Throws: ClassCastException if the objects are not Items, or are items that cannot be convered to strings (e.g. QNames)
Parameters: a the first object to be compared. b the second object to be compared.
Returns: true if the values are equal, false if not
Throws: ClassCastException if the objects are not comparable
Parameters: context the dynamic evaluation context
Returns: either the original AtomicComparer, or a new AtomicComparer in which the context is known. The original AtomicComparer is not modified
Throws: net.sf.saxon.trans.NoDynamicContextException if the context is an "early evaluation" (compile-time) context