Package org.h2.value

Class CompareModeDefault

java.lang.Object
org.h2.value.CompareMode
org.h2.value.CompareModeDefault
All Implemented Interfaces:
Comparator<Value>

public class CompareModeDefault extends CompareMode
The default implementation of CompareMode. It uses java.text.Collator.
  • Field Details

  • Constructor Details

    • CompareModeDefault

      protected CompareModeDefault(String name, int strength)
  • Method Details

    • compareString

      public int compareString(String a, String b, boolean ignoreCase)
      Description copied from class: CompareMode
      Compare two strings.
      Overrides:
      compareString in class CompareMode
      Parameters:
      a - the first string
      b - the second string
      ignoreCase - true if a case-insensitive comparison should be made
      Returns:
      -1 if the first string is 'smaller', 1 if the second string is smaller, and 0 if they are equal
    • equalsChars

      public boolean equalsChars(String a, int ai, String b, int bi, boolean ignoreCase)
      Description copied from class: CompareMode
      Compare two characters in a string.
      Overrides:
      equalsChars in class CompareMode
      Parameters:
      a - the first string
      ai - the character index in the first string
      b - the second string
      bi - the character index in the second string
      ignoreCase - true if a case-insensitive comparison should be made
      Returns:
      true if the characters are equals
    • getKey

      private CollationKey getKey(String a)