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 CompareMode
CHARSET, DEFAULT, ICU4J, OFF -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareString(String a, String b, boolean ignoreCase) Compare two strings.booleanequalsChars(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 CompareMode
compare, compareLocaleNames, equals, getCollationLocales, getCollator, getInstance, getName, getName, getStrength, hashCodeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
collator
-
caseInsensitive
-
-
Constructor Details
-
CompareModeIcu4J
-
-
Method Details
-
compareString
Description copied from class:CompareModeCompare two strings.- Overrides:
compareStringin 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:CompareModeCompare two characters in a string.- Overrides:
equalsCharsin 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
-