Package net.sf.saxon.sort
Class LowercaseFirstCollator
- java.lang.Object
-
- net.sf.saxon.sort.LowercaseFirstCollator
-
- All Implemented Interfaces:
java.io.Serializable
,StringCollator
public class LowercaseFirstCollator extends java.lang.Object implements StringCollator, java.io.Serializable
A StringCollator that sorts lowercase before uppercase.Case is irrelevant, unless the strings are equal ignoring case, in which case lowercase comes first.
- Author:
- Michael H. Kay
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LowercaseFirstCollator(StringCollator base)
Create a LowercaseFirstCollator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
Constructor Detail
-
LowercaseFirstCollator
public LowercaseFirstCollator(StringCollator base)
Create a LowercaseFirstCollator- Parameters:
base
- the base collator, which determines how characters are sorted irrespective of case
-
-
Method Detail
-
compareStrings
public 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.- Specified by:
compareStrings
in interfaceStringCollator
- Parameters:
a
- the first stringb
- the second string- Returns:
- <0 if a0 if a>b
- Throws:
java.lang.ClassCastException
- if the objects are of the wrong type for this Comparer
-
getCollationKey
public java.lang.Object getCollationKey(java.lang.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.- Specified by:
getCollationKey
in interfaceStringCollator
- Parameters:
s
- the string whose collation key is required- Returns:
- the collation key
-
-