Package org.h2.value

Class CharsetCollator

java.lang.Object
java.text.Collator
org.h2.value.CharsetCollator
All Implemented Interfaces:
Cloneable, Comparator<Object>

public class CharsetCollator extends Collator
The charset collator sorts strings according to the order in the given charset.
  • Field Details

    • COMPARATOR

      static final Comparator<byte[]> COMPARATOR
      The comparator used to compare byte arrays.
    • charset

      private final Charset charset
  • Constructor Details

    • CharsetCollator

      public CharsetCollator(Charset charset)
  • Method Details

    • getCharset

      public Charset getCharset()
    • compare

      public int compare(String source, String target)
      Specified by:
      compare in class Collator
    • toBytes

      byte[] toBytes(String source)
      Convert the source to bytes, using the character set.
      Parameters:
      source - the source
      Returns:
      the bytes
    • getCollationKey

      public CollationKey getCollationKey(String source)
      Specified by:
      getCollationKey in class Collator
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class Collator