Class UcaCollationKeyUsingIcu

java.lang.Object
java.text.CollationKey
com.saxonica.expr.sort.UcaCollationKeyUsingIcu
All Implemented Interfaces:
Comparable<CollationKey>

public class UcaCollationKeyUsingIcu extends 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 Details

    • getKey

      public com.ibm.icu.text.CollationKey getKey()
      Get the internal ICU collation key
      Returns:
      the internal ICU collation key
    • compareTo

      public int compareTo(CollationKey target)
      Compare this collation key to another.
      Specified by:
      compareTo in interface Comparable<CollationKey>
      Specified by:
      compareTo in class CollationKey
      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 class CollationKey
      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
      Overrides:
      hashCode in class Object
      Returns:
      a hash code for the collation key
    • equals

      public boolean equals(Object obj)
      Test if two collation keys are equal
      Overrides:
      equals in class Object
      Parameters:
      obj - the other collation key
      Returns:
      true if the argument is an ICU-based collation key representing a string that is considered equal to the string represented by this collation key.