|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.util.comparators.DefaultComparatorFactory
org.clazzes.util.comparators.LocalizedComparatorFactory
public class LocalizedComparatorFactory
This ComparatorFactory implementation returns a localized Collator
instance for String objects and an ComparableComparator instance for
Comparables.
Constructor Summary | |
---|---|
LocalizedComparatorFactory()
Construct a LocalizedComparatorFactory for the current locale and the default strength Collator.IDENTICAL . |
|
LocalizedComparatorFactory(java.util.Locale locale)
Construct a LocalizedComparatorFactory for the given locale and the default strength Collator.IDENTICAL . |
|
LocalizedComparatorFactory(java.util.Locale locale,
int strength)
Construct a LocalizedComparatorFactory for the given locale and the default strength Collator.IDENTICAL . |
Method Summary | |
---|---|
java.text.Collator |
getCollator()
|
java.util.Comparator |
getComparator(java.lang.Class clazz)
Get a comparator, which compares instances of the given class. |
void |
setCollator(java.text.Collator collator)
|
Methods inherited from class org.clazzes.util.comparators.DefaultComparatorFactory |
---|
getInstance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocalizedComparatorFactory()
Collator.IDENTICAL
.
Collator.getInstance()
public LocalizedComparatorFactory(java.util.Locale locale)
Collator.IDENTICAL
.
locale
- The local for which to contruct the string Collator.Collator.getInstance(Locale)
public LocalizedComparatorFactory(java.util.Locale locale, int strength)
Collator.IDENTICAL
.
locale
- The local for which to contruct the string Collator.strength
- The strength of the underlying Collator. One of
Collator.PRIMARY
Collator.SECONDARY
Collator.TERTIARY
Collator.IDENTICAL
Collator.getInstance(Locale)
,
Collator.setStrength(int)
Method Detail |
---|
public java.util.Comparator getComparator(java.lang.Class clazz)
ComparatorFactory
getComparator
in interface ComparatorFactory
getComparator
in class DefaultComparatorFactory
clazz
- The class, which will be compared by the returned Comparator.
public java.text.Collator getCollator()
public void setCollator(java.text.Collator collator)
collator
- The collator for string comparisons to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |