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