public class LocaleCollator extends Collator implements Serializable
Collator and associates it with a Locale. Also, it is Serializable (mostly to help RMMCI).
An instance can be obtained with getInstance(String).| Modifier and Type | Class and Description |
|---|---|
static class |
LocaleCollator.Decomposition
An enum wrapping the 'decompositon' related constants of
Collator. |
static class |
LocaleCollator.Strength
An enum wrapping the 'strength' related constants of
Collator. |
CANONICAL_DECOMPOSITION, FULL_DECOMPOSITION, IDENTICAL, NO_DECOMPOSITION, PRIMARY, SECONDARY, TERTIARY| Constructor and Description |
|---|
LocaleCollator(Locale loc,
Collator col) |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Object o1,
Object o2) |
int |
compare(String source,
String target) |
boolean |
equals(Object that) |
boolean |
equals(String source,
String target) |
CollationKey |
getCollationKey(String source) |
int |
getDecomposition() |
static Collator |
getInstance()
Gets the collator associated with
LocalizedString.getDefault(). |
static Collator |
getInstance(String s)
Get a (fresh) Collator defined by
<locale>:<strength>:<decomposition>
Elements of these string can be left away from the right, or left away by leaving empty. |
int |
getStrength() |
int |
hashCode() |
static void |
main(String[] argv) |
boolean |
matches(String s)
Wether a string matches this Collator.
|
void |
setDecomposition(int decompositionMode) |
void |
setStrength(int newStrength) |
String |
toString() |
clone, getAvailableLocales, getInstancefinalize, getClass, notify, notifyAll, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic static Collator getInstance()
LocalizedString.getDefault().public static Collator getInstance(String s)
<locale>:<strength>:<decomposition>
Elements of these string can be left away from the right, or left away by leaving empty.
For example:
public int compare(Object o1, Object o2)
compare in interface Comparator<Object>compare in class Collatorpublic boolean equals(Object that)
equals in interface Comparator<Object>equals in class Collatorpublic CollationKey getCollationKey(String source)
getCollationKey in class Collatorpublic int getDecomposition()
getDecomposition in class Collatorpublic int getStrength()
getStrength in class Collatorpublic void setDecomposition(int decompositionMode)
setDecomposition in class Collatorpublic void setStrength(int newStrength)
setStrength in class Collatorpublic boolean matches(String s)
getInstance(String). Unspecified values never make the result false.MMBase 1.9-SNAPSHOT - ${javadoctimestamp}