public class SimpleCollation extends java.lang.Object implements StringCollator
Constructor and Description |
---|
SimpleCollation(java.lang.String uri,
java.util.Comparator comparator)
Create a SimpleCollation
|
Modifier and Type | Method and Description |
---|---|
boolean |
comparesEqual(java.lang.CharSequence s1,
java.lang.CharSequence s2)
Compare two strings for equality.
|
int |
compareStrings(java.lang.CharSequence o1,
java.lang.CharSequence o2)
Compares its two arguments for order.
|
AtomicMatchKey |
getCollationKey(java.lang.CharSequence s)
Get a collation key for a String.
|
java.lang.String |
getCollationURI()
Get the collation URI.
|
java.util.Comparator |
getComparator()
Get the underlying comparator
|
SubstringMatcher |
getSubstringMatcher()
If possible, get a collator capable of substring matching (in functions such as fn:contains()).
|
void |
setComparator(java.util.Comparator comparator)
Set the underlying comparator
|
public SimpleCollation(java.lang.String uri, java.util.Comparator comparator)
uri
- the collation URIcomparator
- the Comparator that does the actual string comparisonpublic java.lang.String getCollationURI()
getCollationURI
in interface StringCollator
public int compareStrings(java.lang.CharSequence o1, java.lang.CharSequence o2)
compareStrings
in interface StringCollator
o1
- the first object to be compared.o2
- the second object to be compared.java.lang.ClassCastException
- if the arguments' types prevent them from
being compared by this Comparator.public boolean comparesEqual(java.lang.CharSequence s1, java.lang.CharSequence s2)
comparesEqual
in interface StringCollator
s1
- the first strings2
- the second stringpublic java.util.Comparator getComparator()
public void setComparator(java.util.Comparator comparator)
comparator
- the underlying comparatorpublic AtomicMatchKey getCollationKey(java.lang.CharSequence s)
getCollationKey
in interface StringCollator
s
- public SubstringMatcher getSubstringMatcher()
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.