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 TypeMethodDescriptionintcompareTo(CollationKey target) Compare this collation key to another.booleanTest if two collation keys are equalcom.ibm.icu.text.CollationKeygetKey()Get the internal ICU collation keyinthashCode()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:
compareToin interfaceComparable<CollationKey>- Specified by:
compareToin 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:
toByteArrayin 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
-