public class TextComparer extends Object implements Comparator, Serializable
Constructor and Description |
---|
TextComparer(Comparator collator) |
Modifier and Type | Method and Description |
---|---|
int |
compare(Object a,
Object b)
Compare two Items by converting them to strings and comparing the string values.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public TextComparer(Comparator collator)
public int compare(Object a, Object b) throws ClassCastException
compare
in interface Comparator
a
- the first Item to be compared.b
- the second Item to be compared.ClassCastException
- if the objects are not Items, or are items that cannot be convered
to strings (e.g. QNames)