public class CollatorComparator extends Object implements Comparator<String>
Comparator<Object>
and the required
compare(String, String)
method, you can't safely cast Collator
to Comparator<String>
.Modifier and Type | Field and Description |
---|---|
static Comparator<String> |
DEFAULT_LOCALE_COMPARATOR |
protected Collator |
m_collator |
Constructor and Description |
---|
CollatorComparator()
Default constructor uses the current locale's collator.
|
CollatorComparator(Collator collator)
Construct with a specific collator.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(String str1,
String str2) |
void |
setCollator(Collator collator)
Specify a new collator.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals
public static final Comparator<String> DEFAULT_LOCALE_COMPARATOR
protected Collator m_collator
public CollatorComparator()
public CollatorComparator(Collator collator)
collator
- the collator to be used for comparisonsCopyright © 2001-2018 The Apache Software Foundation. All rights reserved.