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