net.sf.saxon.sort

Class TextComparer

public class TextComparer extends Object implements Comparator, Serializable

A Comparer used for comparing sort keys when data-type="text". The items to be compared are converted to strings, and the strings are then compared using an underlying collator

Author: Michael H. Kay

Constructor Summary
TextComparer(Comparator collator)
Method Summary
intcompare(Object a, Object b)
Compare two Items by converting them to strings and comparing the string values.

Constructor Detail

TextComparer

public TextComparer(Comparator collator)

Method Detail

compare

public int compare(Object a, Object b)
Compare two Items by converting them to strings and comparing the string values.

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)