Package com.saxonica.expr.sort
Class UcaCollationKeyUsingIcu
java.lang.Object
java.text.CollationKey
com.saxonica.expr.sort.UcaCollationKeyUsingIcu
- All Implemented Interfaces:
Comparable<CollationKey>
This class is an implementation of Saxon collation keys based on
the functionality of collation keys supplied by the ICU library.
Collation keys are used not only to support the
fn:collation-key
function in XPath, but also internally to support fn:distinct-values
,
xsl:for-each-group
, and XQuery grouping.-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(CollationKey target) Compare this collation key to another.boolean
Test if two collation keys are equalcom.ibm.icu.text.CollationKey
getKey()
Get the internal ICU collation keyint
hashCode()
Get a hash code supporting the equals() methodbyte[]
Get a binary representation of this collection keyMethods inherited from class java.text.CollationKey
getSourceString
-
Method Details
-
getKey
public com.ibm.icu.text.CollationKey getKey()Get the internal ICU collation key- Returns:
- the internal ICU collation key
-
compareTo
Compare this collation key to another.- Specified by:
compareTo
in interfaceComparable<CollationKey>
- Specified by:
compareTo
in classCollationKey
- Parameters:
target
- the other collation key- Returns:
- true if the collation keys are equal, implying that the corresponding strings are to be considered equal
- Throws:
ClassCastException
- if the other collation key is not an ICU-based collation key.
-
toByteArray
public byte[] toByteArray()Get a binary representation of this collection key- Specified by:
toByteArray
in classCollationKey
- Returns:
- a binary representation of the key, such that binary comparison can be used to compare keys.
-
hashCode
public int hashCode()Get a hash code supporting the equals() method -
equals
Test if two collation keys are equal
-