net.sf.saxon.sort
Class AlphanumericCollator
java.lang.Object
net.sf.saxon.sort.AlphanumericCollator
- Serializable, StringCollator
public class AlphanumericCollator
extends java.lang.Object
A Comparer that treats strings as an alternating sequence of alpha parts and numeric parts. The
alpha parts are compared using a base collation supplied as a parameter; the numeric parts are
compared numerically. "Numeric" here means a sequence of consecutive ASCII digits 0-9.
Note: this StringCollator produces an ordering that is not compatible with equals().
AlphanumericCollator
public AlphanumericCollator(StringCollator base)
Create an alphanumeric collation
base
- the collation used to compare the alphabetic parts of the string
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