public class CompareMode extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT
This constant means the default collator should be used, even if ICU4J is
in the classpath.
|
static String |
ICU4J
This constant means ICU4J should be used (this will fail if it is not in
the classpath).
|
static String |
OFF
This constant means there is no collator set, and the default string
comparison is to be used.
|
static String |
SIGNED
This constant means that the BINARY columns are sorted as if the bytes
were signed.
|
static String |
UNSIGNED
This constant means that the BINARY columns are sorted as if the bytes
were unsigned.
|
Modifier | Constructor and Description |
---|---|
protected |
CompareMode(String name,
int strength,
boolean binaryUnsigned) |
Modifier and Type | Method and Description |
---|---|
int |
compareString(String a,
String b,
boolean ignoreCase)
Compare two strings.
|
boolean |
equals(Object obj) |
boolean |
equalsChars(String a,
int ai,
String b,
int bi,
boolean ignoreCase)
Compare two characters in a string.
|
static Collator |
getCollator(String name)
Get the collator object for the given language name or language / country
combination.
|
static CompareMode |
getInstance(String name,
int strength)
Create a new compare mode with the given collator and strength.
|
static CompareMode |
getInstance(String name,
int strength,
boolean binaryUnsigned)
Create a new compare mode with the given collator and strength.
|
String |
getName() |
static String |
getName(Locale l)
Get the collation name.
|
int |
getStrength() |
int |
hashCode() |
boolean |
isBinaryUnsigned() |
public static final String OFF
public static final String DEFAULT
public static final String ICU4J
public static final String SIGNED
public static final String UNSIGNED
protected CompareMode(String name, int strength, boolean binaryUnsigned)
public static CompareMode getInstance(String name, int strength)
name
- the collation name or nullstrength
- the collation strengthpublic static CompareMode getInstance(String name, int strength, boolean binaryUnsigned)
name
- the collation name or nullstrength
- the collation strengthbinaryUnsigned
- whether to compare binaries as unsignedpublic boolean equalsChars(String a, int ai, String b, int bi, boolean ignoreCase)
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 madepublic int compareString(String a, String b, boolean ignoreCase)
a
- the first stringb
- the second stringignoreCase
- true if a case-insensitive comparison should be madepublic static String getName(Locale l)
l
- the localepublic static Collator getCollator(String name)
name
- the language namepublic String getName()
public int getStrength()
public boolean isBinaryUnsigned()
Copyright © 2017 JBoss by Red Hat. All rights reserved.