Package net.sf.saxon.sort
Class AlphanumericComparer
java.lang.Object
net.sf.saxon.sort.AlphanumericComparer
- All Implemented Interfaces:
Serializable,Comparator
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 Comparator produces an ordering that is not compatible with equals().
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
AlphanumericComparer
-
-
Method Details
-
compare
Compare two objects.- Specified by:
comparein interfaceComparator- Returns:
- invalid input: '<'0 if ainvalid input: '<'b, 0 if a=b, >0 if a>b
-