com.icl.saxon.sort

Class StringComparer


public class StringComparer
extends TextComparer

A Comparer used for comparing keys. This comparer uses the binary Unicode value of the characters.

Field Summary

Fields inherited from class com.icl.saxon.sort.TextComparer

DEFAULT_CASE_ORDER, LOWERCASE_FIRST, UPPERCASE_FIRST

Method Summary

int
compare(Object a, Object b)
Compare two string objects using default collating
Comparer
setCaseOrder(int caseOrder)
Set case order

Methods inherited from class com.icl.saxon.sort.TextComparer

setCaseOrder

Methods inherited from class com.icl.saxon.sort.Comparer

compare, setDataType, setOrder

Method Details

compare

public int compare(Object a,
                   Object b)
Compare two string objects using default collating
Overrides:
compare in interface Comparer

Returns:
<0 if a0 if a>b


setCaseOrder

public Comparer setCaseOrder(int caseOrder)
Set case order
Overrides:
setCaseOrder in interface TextComparer

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.