Class TextComparer
java.lang.Object
net.sf.saxon.sort.TextComparer
- All Implemented Interfaces:
Serializable, Comparator
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
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
TextComparer
-
-
Method Details
-
compare
Compare two Items by converting them to strings and comparing the string values.- Specified by:
comparein interfaceComparator- Parameters:
a- the first Item to be compared.b- the second Item to be compared.- Returns:
- invalid input: '<'0 if ainvalid input: '<'b, 0 if a=b, >0 if a>b
- Throws:
ClassCastException- if the objects are not Items, or are items that cannot be convered to strings (e.g. QNames)
-