net.sf.saxon.sort
Class UppercaseFirstCollator
java.lang.Object
net.sf.saxon.sort.UppercaseFirstCollator
- Serializable, StringCollator
public class UppercaseFirstCollator
extends java.lang.Object
A Collator used for comparing strings, with upper case collated before lower case
if the strings are otherwise equal. This is implemented as a wrapper around a collator
that compares the strings ignoring case.
int | compareStrings(String a, String b) - Compare two string objects: case is irrelevant, unless the strings are equal ignoring
case, in which case uppercase comes first.
|
Object | getCollationKey(String s) - Get a collation key for two Strings.
|
UppercaseFirstCollator
public UppercaseFirstCollator(StringCollator base)
Create an UppercaseFirstCollator
base
- the base collator used to compare strings irrespective of case
compareStrings
public int compareStrings(String a,
String b)
Compare two string objects: case is irrelevant, unless the strings are equal ignoring
case, in which case uppercase comes first.
- compareStrings in interface StringCollator
getCollationKey
public Object getCollationKey(String s)
Get a collation key for two Strings. The essential property of collation keys
is that if two values are equal under the collation, then the collation keys are
compare correctly under the equals() method.
- getCollationKey in interface StringCollator