public class SimpleCollation extends Object implements StringCollator
Constructor and Description |
---|
SimpleCollation(String uri,
Comparator comparator)
Create a SimpleCollation
|
Modifier and Type | Method and Description |
---|---|
boolean |
comparesEqual(CharSequence s1,
CharSequence s2)
Compare two strings for equality.
|
int |
compareStrings(CharSequence o1,
CharSequence o2)
Compares its two arguments for order.
|
AtomicMatchKey |
getCollationKey(CharSequence s)
Get a collation key for a String.
|
String |
getCollationURI()
Get the collation URI.
|
Comparator |
getComparator()
Get the underlying comparator
|
void |
setComparator(Comparator comparator)
Set the underlying comparator
|
public SimpleCollation(String uri, Comparator comparator)
uri
- the collation URIcomparator
- the Comparator that does the actual string comparisonpublic String getCollationURI()
getCollationURI
in interface StringCollator
public int compareStrings(CharSequence o1, CharSequence 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(CharSequence s1, CharSequence s2)
comparesEqual
in interface StringCollator
s1
- the first strings2
- the second stringpublic Comparator getComparator()
public void setComparator(Comparator comparator)
comparator
- the underlying comparatorpublic AtomicMatchKey getCollationKey(CharSequence s)
getCollationKey
in interface StringCollator
s
- Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.