Package org.h2.value
Class CompareModeIcu4J
java.lang.Object
org.h2.value.CompareMode
org.h2.value.CompareModeIcu4J
- All Implemented Interfaces:
Comparator<Value>
An implementation of CompareMode that uses the ICU4J Collator.
-
Field Summary
FieldsFields inherited from class org.h2.value.CompareMode
CHARSET, DEFAULT, ICU4J, OFF
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compareString
(String a, String b, boolean ignoreCase) Compare two strings.boolean
equalsChars
(String a, int ai, String b, int bi, boolean ignoreCase) Compare two characters in a string.private static Comparator
<String> getIcu4jCollator
(String name, int strength) Methods inherited from class org.h2.value.CompareMode
compare, compareLocaleNames, equals, getCollationLocales, getCollator, getInstance, getName, getName, getStrength, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
collator
-
caseInsensitive
-
-
Constructor Details
-
CompareModeIcu4J
-
-
Method Details
-
compareString
Description copied from class:CompareMode
Compare two strings.- Overrides:
compareString
in classCompareMode
- Parameters:
a
- the first stringb
- the second stringignoreCase
- 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
Description copied from class:CompareMode
Compare two characters in a string.- Overrides:
equalsChars
in classCompareMode
- Parameters:
a
- the first stringai
- the character index in the first stringb
- the second stringbi
- the character index in the second stringignoreCase
- true if a case-insensitive comparison should be made- Returns:
- true if the characters are equals
-
getIcu4jCollator
-