Class UcaCollationKeyUsingIcu

  • All Implemented Interfaces:
    java.lang.Comparable<java.text.CollationKey>

    public class UcaCollationKeyUsingIcu
    extends java.text.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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(java.text.CollationKey target)
      Compare this collation key to another.
      boolean equals​(java.lang.Object obj)
      Test if two collation keys are equal
      com.ibm.icu.text.CollationKey getKey()
      Get the internal ICU collation key
      int hashCode()
      Get a hash code supporting the equals() method
      byte[] toByteArray()
      Get a binary representation of this collection key
      • Methods inherited from class java.text.CollationKey

        getSourceString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getKey

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

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

        public boolean equals​(java.lang.Object obj)
        Test if two collation keys are equal
        Overrides:
        equals in class java.lang.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.