public class UcaCollatorUsingJava extends java.lang.Object implements SubstringMatcher
Constructor and Description |
---|
UcaCollatorUsingJava(java.lang.String uri)
Create a collation from a given collation URI
|
Modifier and Type | Method and Description |
---|---|
boolean |
comparesEqual(java.lang.CharSequence s1,
java.lang.CharSequence s2)
Ask whether two strings are considered equal under this collation
|
int |
compareStrings(java.lang.CharSequence o1,
java.lang.CharSequence o2)
Compare two strings for equality or ordering under the rules of this collation
|
boolean |
contains(java.lang.String s1,
java.lang.String s2)
Test whether one string contains another, according to the rules
of the XPath contains() function
|
boolean |
endsWith(java.lang.String s1,
java.lang.String s2)
Test whether one string ends with another, according to the rules
of the XPath ends-with() function
|
AtomicMatchKey |
getCollationKey(java.lang.CharSequence s)
Get a collation key that can be used as a proxy for strings being compared
|
java.lang.String |
getCollationURI()
Get the collation URI corresponding to this collation
|
java.text.CollationKey |
getJavaCollationKey(java.lang.String source)
Factory method to create a CollationKey that can be used as a proxy for
string comparisons under this collation
|
java.util.Properties |
getProperties()
Get the properties of the collation
|
java.text.RuleBasedCollator |
getRuleBasedCollator()
Get the underlying Java Collator object
|
int |
getStrength()
Get the strength of the collation (primary, secondary, tertiary, etc)
|
int |
hashCode()
Get a hash code used to compare two collations.
|
void |
setStrength(int newStrength)
Set the strength of the collation (primary, secondary, tertiary, etc)
|
boolean |
startsWith(java.lang.String s1,
java.lang.String s2)
Test whether one string starts with another, according to the rules
of the XPath starts-with() function
|
java.lang.String |
substringAfter(java.lang.String s1,
java.lang.String s2)
Return the part of a string after a given substring, according to the rules
of the XPath substring-after() function
|
java.lang.String |
substringBefore(java.lang.String s1,
java.lang.String s2)
Return the part of a string before a given substring, according to the rules
of the XPath substring-before() function
|
public UcaCollatorUsingJava(java.lang.String uri) throws XPathException
uri
- the collation URI, in the format defined in the W3C Functions and Operators
specificationXPathException
- if the collation URI does not conform to the W3C rules, or if it
requires features that Saxon-HE does not supportpublic java.text.RuleBasedCollator getRuleBasedCollator()
public java.text.CollationKey getJavaCollationKey(java.lang.String source)
source
- the string whose CollationKey is requiredObject.equals(Object)
method if their corresponding strings are
considered to be equal under this collationpublic int hashCode()
hashCode
in class java.lang.Object
public java.util.Properties getProperties()
public void setStrength(int newStrength)
newStrength
- the strengthpublic int getStrength()
public boolean comparesEqual(java.lang.CharSequence s1, java.lang.CharSequence s2)
comparesEqual
in interface StringCollator
s1
- the first strings2
- the second stringpublic 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 stringo2
- the second stringpublic AtomicMatchKey getCollationKey(java.lang.CharSequence s)
getCollationKey
in interface StringCollator
s
- the string whose collation key is requiredpublic boolean contains(java.lang.String s1, java.lang.String s2)
contains
in interface SubstringMatcher
s1
- the containing strings2
- the contained stringpublic boolean endsWith(java.lang.String s1, java.lang.String s2)
endsWith
in interface SubstringMatcher
s1
- the containing strings2
- the contained stringpublic boolean startsWith(java.lang.String s1, java.lang.String s2)
startsWith
in interface SubstringMatcher
s1
- the containing strings2
- the contained stringpublic java.lang.String substringAfter(java.lang.String s1, java.lang.String s2)
substringAfter
in interface SubstringMatcher
s1
- the containing strings2
- the contained stringpublic java.lang.String substringBefore(java.lang.String s1, java.lang.String s2)
substringBefore
in interface SubstringMatcher
s1
- the containing strings2
- the contained stringCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.