Package net.sf.saxon.expr.sort
Class CodepointCollator
- java.lang.Object
- 
- net.sf.saxon.expr.sort.CodepointCollator
 
- 
- All Implemented Interfaces:
- StringCollator,- SubstringMatcher
 
 public class CodepointCollator extends java.lang.Object implements StringCollator, SubstringMatcher A collating sequence that uses Unicode codepoint ordering
- 
- 
Constructor SummaryConstructors Constructor Description CodepointCollator()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancomparesEqual(UnicodeString s1, UnicodeString s2)Test whether one string is equal to another, according to the rules of the XPath compare() function.intcompareStrings(UnicodeString a, UnicodeString b)Compare two string objects.booleancontains(UnicodeString s1, UnicodeString s2)Test whether one string contains another, according to the rules of the XPath contains() functionbooleanendsWith(UnicodeString s1, UnicodeString s2)Test whether one string ends with another, according to the rules of the XPath ends-with() functionAtomicMatchKeygetCollationKey(UnicodeString s)Get a collation key for a string.java.lang.StringgetCollationURI()Get the collation URI.static CodepointCollatorgetInstance()booleanstartsWith(UnicodeString s1, UnicodeString s2)Test whether one string starts with another, according to the rules of the XPath starts-with() functionUnicodeStringsubstringAfter(UnicodeString s1, UnicodeString s2)Return the part of a string after a given substring, according to the rules of the XPath substring-after() functionUnicodeStringsubstringBefore(UnicodeString s1, UnicodeString s2)Return the part of a string before a given substring, according to the rules of the XPath substring-before() function
 
- 
- 
- 
Method Detail- 
getInstancepublic static CodepointCollator getInstance() 
 - 
getCollationURIpublic java.lang.String getCollationURI() Get the collation URI. It must be possible to use this collation URI to reconstitute the collation- Specified by:
- getCollationURIin interface- StringCollator
- Returns:
- a collation URI that can be used to reconstruct the collation when an XSLT package is reloaded.
 
 - 
compareStringspublic int compareStrings(UnicodeString a, UnicodeString b) Compare two string objects.- Specified by:
- compareStringsin interface- StringCollator
- Parameters:
- a- the first string
- b- the second string
- Returns:
- N < 0 if a < b, N = 0 if a=b, N > 0 if a > b
- Throws:
- java.lang.ClassCastException- if the objects are of the wrong type for this Comparer
 
 - 
comparesEqualpublic boolean comparesEqual(UnicodeString s1, UnicodeString s2) Test whether one string is equal to another, according to the rules of the XPath compare() function. The result is true if and only if the compare() method returns zero: but the implementation may be more efficient than calling compare and testing the result for zero- Specified by:
- comparesEqualin interface- StringCollator
- Parameters:
- s1- the first string
- s2- the second string
- Returns:
- true iff s1 equals s2
 
 - 
containspublic boolean contains(UnicodeString s1, UnicodeString s2) Test whether one string contains another, according to the rules of the XPath contains() function- Specified by:
- containsin interface- SubstringMatcher
- Parameters:
- s1- the containing string
- s2- the contained string
- Returns:
- true iff s1 contains s2
 
 - 
endsWithpublic boolean endsWith(UnicodeString s1, UnicodeString s2) Test whether one string ends with another, according to the rules of the XPath ends-with() function- Specified by:
- endsWithin interface- SubstringMatcher
- Parameters:
- s1- the containing string
- s2- the contained string
- Returns:
- true iff s1 ends with s2
 
 - 
startsWithpublic boolean startsWith(UnicodeString s1, UnicodeString s2) Test whether one string starts with another, according to the rules of the XPath starts-with() function- Specified by:
- startsWithin interface- SubstringMatcher
- Parameters:
- s1- the containing string
- s2- the contained string
- Returns:
- true iff s1 starts with s2
 
 - 
substringAfterpublic UnicodeString substringAfter(UnicodeString s1, UnicodeString s2) Return the part of a string after a given substring, according to the rules of the XPath substring-after() function- Specified by:
- substringAfterin interface- SubstringMatcher
- Parameters:
- s1- the containing string
- s2- the contained string
- Returns:
- the part of s1 that follows the first occurrence of s2
 
 - 
substringBeforepublic UnicodeString substringBefore(UnicodeString s1, UnicodeString s2) Return the part of a string before a given substring, according to the rules of the XPath substring-before() function- Specified by:
- substringBeforein interface- SubstringMatcher
- Parameters:
- s1- the containing string
- s2- the contained string
- Returns:
- the part of s1 that precedes the first occurrence of s2
 
 - 
getCollationKeypublic AtomicMatchKey getCollationKey(UnicodeString s) Get a collation key for a string. The essential property of collation keys is that if two values are equal under the collation, then the collation keys are compare correctly under the equals() method.- Specified by:
- getCollationKeyin interface- StringCollator
- Parameters:
- s- the string whose collation key is required
- Returns:
- the collation key
 
 
- 
 
-