Package eu.woolplatform.utils.i18n
Class I18nComparator
- java.lang.Object
-
- eu.woolplatform.utils.i18n.I18nComparator
-
- All Implemented Interfaces:
Comparator<String>
public class I18nComparator extends Object implements Comparator<String>
This comparator can compare strings using a collator for a specified locale. The collator has primary strength, which means that diacritics and case are ignored.
-
-
Constructor Summary
Constructors Constructor Description I18nComparator()Constructs a new comparator with the default locale.I18nComparator(Locale locale)Constructs a new comparator with the specified locale.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(String o1, String o2)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
I18nComparator
public I18nComparator()
Constructs a new comparator with the default locale.
-
I18nComparator
public I18nComparator(Locale locale)
Constructs a new comparator with the specified locale. If the locale is null, it will use the default locale.- Parameters:
locale- the locale or null
-
-
Method Detail
-
compare
public int compare(String o1, String o2)
- Specified by:
comparein interfaceComparator<String>
-
-