|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.expr.sort.AlphanumericCollator
public class AlphanumericCollator
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().
Constructor Summary | |
---|---|
AlphanumericCollator(StringCollator base)
Create an alphanumeric collation |
Method Summary | |
---|---|
boolean |
comparesEqual(String s1,
String s2)
Compare two strings for equality. |
int |
compareStrings(String s1,
String s2)
Compare two objects. |
Object |
getCollationKey(String s)
Get a collation key for two Strings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AlphanumericCollator(StringCollator base)
base
- the collation used to compare the alphabetic parts of the stringMethod Detail |
---|
public int compareStrings(String s1, String s2)
compareStrings
in interface StringCollator
s1
- the first strings2
- the second string
public boolean comparesEqual(String s1, String s2)
comparesEqual
in interface StringCollator
s1
- the first strings2
- the second string
public Object getCollationKey(String s)
getCollationKey
in interface StringCollator
s
- the string whose collation key is required
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |