T - type to be comparedpublic abstract class CultureComparator<T> extends Object implements Comparator<T>
comparators holds all available comparators keyed
by name of comparator's class. It uses collator collator for comparing objects.| Modifier and Type | Field and Description |
|---|---|
protected Collator |
collator |
protected static String |
DEFAULT_LOCALE |
| Modifier | Constructor and Description |
|---|---|
protected |
CultureComparator(String sLocale)
Protected construcotr that creates collator according to the locale.
|
| Modifier and Type | Method and Description |
|---|---|
abstract int |
compare(T arg0,
T arg1)
Comparing method.
|
protected static CultureComparator<?> |
getInstance(Class<?> clazz,
String locale)
Gets instance of CultureComparator stored in hashmap
comparators by comparator's class
and locale. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequalsprotected static final String DEFAULT_LOCALE
protected Collator collator
protected CultureComparator(String sLocale)
sLocale - localepublic abstract int compare(T arg0, T arg1)
compare in interface Comparator<T>protected static CultureComparator<?> getInstance(Class<?> clazz, String locale) throws Exception
comparators by comparator's class
and locale. If no instance is present in hashmap, a new instance is created.clazz - comparator's classlocale - localeExceptionCopyright © 2015. All Rights Reserved.