Top Description Fields Constructors Methods
org.h2.value

public Class CompareModeIcu4J

extends CompareMode
Class Inheritance
Imports
java.lang.reflect.Method, java.text.Collator, java.util.Comparator, .Locale, org.h2.message.DbException, org.h2.util.JdbcUtils, .StringUtils

An implementation of CompareMode that uses the ICU4J Collator.

Field Summary

Modifier and TypeField and Description
private volatile CompareModeIcu4J
private final Comparator<String>
Inherited from org.h2.value.CompareMode:
CHARSETDEFAULTICU4JOFF

Constructor Summary

AccessConstructor and Description
protected
CompareModeIcu4J(String name, int strength)

Method Summary

Modifier and TypeMethod and Description
public int
compareString(String
the first string
a
,
String
the second string
b
,
boolean
true if a case-insensitive comparison should be made
ignoreCase
)

Overrides org.h2.value.CompareMode.compareString.

Compare two strings.

public boolean
equalsChars(String
the first string
a
,
int
the character index in the first string
ai
,
String
the second string
b
,
int
the character index in the second string
bi
,
boolean
true if a case-insensitive comparison should be made
ignoreCase
)

Overrides org.h2.value.CompareMode.equalsChars.

Compare two characters in a string.

private static Comparator<String>
getIcu4jCollator(String name, int strength)

Inherited from org.h2.value.CompareMode:
comparecompareLocaleNamesequalsgetCollationLocalesgetCollatorgetInstancegetNamegetNamegetStrengthhashCode

Field Detail

caseInsensitiveback to summary
private volatile CompareModeIcu4J caseInsensitive
collatorback to summary
private final Comparator<String> collator

Constructor Detail

CompareModeIcu4Jback to summary
protected CompareModeIcu4J(String name, int strength)

Method Detail

compareStringback to summary
public int compareString(String a, String b, boolean ignoreCase)

Overrides org.h2.value.CompareMode.compareString.

Doc from org.h2.value.CompareMode.compareString.

Compare two strings.

Parameters
a:String

the first string

b:String

the second string

ignoreCase:boolean

true if a case-insensitive comparison should be made

Returns:int

-1 if the first string is 'smaller', 1 if the second string is smaller, and 0 if they are equal

Annotations
@Override
equalsCharsback to summary
public boolean equalsChars(String a, int ai, String b, int bi, boolean ignoreCase)

Overrides org.h2.value.CompareMode.equalsChars.

Doc from org.h2.value.CompareMode.equalsChars.

Compare two characters in a string.

Parameters
a:String

the first string

ai:int

the character index in the first string

b:String

the second string

bi:int

the character index in the second string

ignoreCase:boolean

true if a case-insensitive comparison should be made

Returns:boolean

true if the characters are equals

Annotations
@Override
getIcu4jCollatorback to summary
private static Comparator<String> getIcu4jCollator(String name, int strength)
Annotations
@SuppressWarnings:unchecked