Class StringComparer
java.lang.Object
com.icl.saxon.sort.Comparer
com.icl.saxon.sort.TextComparer
com.icl.saxon.sort.StringComparer
A Comparer used for comparing keys. This comparer uses the binary Unicode value of the
characters.
- Author:
- Michael H. Kay
-
Field Summary
Fields inherited from class TextComparer
DEFAULT_CASE_ORDER, LOWERCASE_FIRST, UPPERCASE_FIRST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompare two string objects using default collatingsetCaseOrder(int caseOrder) Set case orderMethods inherited from class Comparer
setDataType, setOrder
-
Constructor Details
-
StringComparer
public StringComparer()
-
-
Method Details
-
compare
Compare two string objects using default collating- Specified by:
comparein classComparer- Returns:
- invalid input: '<'0 if ainvalid input: '<'b, 0 if a=b, >0 if a>b
- Throws:
ClassCastException- if the objects are of the wrong type for this Comparer
-
setCaseOrder
Set case order- Overrides:
setCaseOrderin classTextComparer- Parameters:
caseOrder- one of DEFAULT_CASE_ORDER, LOWERCASE_FIRST, or UPPERCASE_FIRST. Indicates whether upper case letters precede or follow lower case letters in the ordering- Returns:
- either this or a different Comparer that will be used to perform the comparisons. This allows the TextComparer to delegate the comparison to a Comparer dedicated to a specific case order.
-