net.sf.saxon.sort
Interface StringCollator
- Serializable
- SubstringMatcher
- AlphanumericCollator, CodepointCollator, DotNetComparator, LowercaseFirstCollator, NamedCollation, RuleBasedSubstringMatcher, UppercaseFirstCollator
public interface StringCollator
extends Serializable
This interface represents a "collation" as defined in XPath, that is, a set of rules for comparing strings
compareStrings
public int compareStrings(String o1,
String o2)
Compare two strings
o1
- the first stringo2
- the second string
- 0 if the strings are considered equal, a negative integer if the first string is less than the second,
a positive integer if the first string is greater than the second
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.
s
- the string whose collation key is required