public class SimpleCollation extends Object implements StringCollator
Constructor and Description |
---|
SimpleCollation(Comparator collation)
Create a SimpleCollation
|
Modifier and Type | Method and Description |
---|---|
boolean |
comparesEqual(String s1,
String s2)
Compare two strings for equality.
|
int |
compareStrings(String o1,
String o2)
Compares its two arguments for order.
|
Comparator |
getCollation()
Get the underlying comparator
|
AtomicMatchKey |
getCollationKey(String s)
Get a collation key for a String.
|
void |
setCollation(Comparator collation)
Set the underlying comparator
|
public SimpleCollation(Comparator collation)
collation
- the Comparator that does the actual string comparisonpublic int compareStrings(String o1, String o2)
compareStrings
in interface StringCollator
o1
- the first object to be compared.o2
- the second object to be compared.ClassCastException
- if the arguments' types prevent them from
being compared by this Comparator.public boolean comparesEqual(String s1, String s2)
comparesEqual
in interface StringCollator
s1
- the first strings2
- the second stringpublic Comparator getCollation()
public void setCollation(Comparator collation)
collation
- the underlying comparatorpublic AtomicMatchKey getCollationKey(String s)
getCollationKey
in interface StringCollator
s
- the string whose collation key is requiredCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.