java.io.Serializable
, StringCollator
public class CaseFirstCollator extends java.lang.Object implements StringCollator, java.io.Serializable
Case is irrelevant, unless the strings are equal ignoring case, in which case lowercase comes first.
Constructor | Description |
---|---|
CaseFirstCollator(StringCollator base,
boolean upperFirst) |
Create a CaseFirstCollator
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
comparesEqual(java.lang.String s1,
java.lang.String s2) |
Compare two strings for equality.
|
int |
compareStrings(java.lang.String a,
java.lang.String b) |
Compare two string objects: case is irrelevant, unless the strings are equal ignoring
case, in which case lowercase comes first.
|
java.lang.Object |
getCollationKey(java.lang.String s) |
Get a collation key for two Strings.
|
public CaseFirstCollator(StringCollator base, boolean upperFirst)
base
- the base collator, which determines how characters are sorted irrespective of caseupperFirst
- true if uppercase precedes lowercase, false otherwisepublic int compareStrings(java.lang.String a, java.lang.String b)
compareStrings
in interface StringCollator
a
- the first stringb
- the second stringjava.lang.ClassCastException
- if the objects are of the wrong type for this Comparerpublic boolean comparesEqual(java.lang.String s1, java.lang.String s2)
comparesEqual
in interface StringCollator
s1
- the first strings2
- the second stringpublic java.lang.Object getCollationKey(java.lang.String s)
getCollationKey
in interface StringCollator
s
- the string whose collation key is required