DATATYPE - the type of object to be comparedpublic abstract class AbstractCollationComparator<DATATYPE> extends AbstractComparator<DATATYPE>
Comparator that uses
collations for ordering. This is only necessary when comparing strings.| Constructor and Description |
|---|
AbstractCollationComparator()
Comparator with default locale
Collator and default sort order. |
AbstractCollationComparator(Collator aCollator)
Constructor with
Collator using the default sort order |
AbstractCollationComparator(Collator aCollator,
Comparator<? super DATATYPE> aNestedComparator)
Constructor with
Collator using the default sort order and a nested
comparator. |
AbstractCollationComparator(Collator aCollator,
ESortOrder eSortOrder)
Constructor with
Collator and sort order. |
AbstractCollationComparator(Collator aCollator,
ESortOrder eSortOrder,
Comparator<? super DATATYPE> aNestedComparator)
Constructor with
Collator and sort order and a nested comparator. |
AbstractCollationComparator(Comparator<? super DATATYPE> aNestedComparator)
Comparator with default locale
Collator and default sort order and
a nested comparator. |
AbstractCollationComparator(ESortOrder eSortOrder)
Comparator with default locale
Collator. |
AbstractCollationComparator(ESortOrder eSortOrder,
Comparator<? super DATATYPE> aNestedComparator)
Comparator with default locale
Collator and a nested comparator. |
AbstractCollationComparator(Locale aSortLocale)
Comparator with default sort order and specified sort locale.
|
AbstractCollationComparator(Locale aSortLocale,
Comparator<? super DATATYPE> aNestedComparator)
Comparator with default sort order but special locale and a nested
comparator.
|
AbstractCollationComparator(Locale aSortLocale,
ESortOrder eSortOrder)
Constructor with locale and sort order.
|
AbstractCollationComparator(Locale aSortLocale,
ESortOrder eSortOrder,
Comparator<? super DATATYPE> aNestedComparator)
Constructor with locale and sort order and a nested comparator.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract String |
asString(DATATYPE aObject)
Abstract method that needs to be overridden to convert an object to a
string representation for comparison.
|
protected int |
mainCompare(DATATYPE aElement1,
DATATYPE aElement2) |
String |
toString() |
compare, getSortOrder, setSortOrderclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequalspublic AbstractCollationComparator()
Collator and default sort order.public AbstractCollationComparator(@Nullable Comparator<? super DATATYPE> aNestedComparator)
Collator and default sort order and
a nested comparator.aNestedComparator - The nested comparator to be invoked, when the main comparison
resulted in 0.public AbstractCollationComparator(@Nonnull ESortOrder eSortOrder)
Collator.eSortOrder - The sort order to use. May not be null.public AbstractCollationComparator(@Nonnull ESortOrder eSortOrder, @Nullable Comparator<? super DATATYPE> aNestedComparator)
Collator and a nested comparator.eSortOrder - The sort order to use. May not be null.aNestedComparator - The nested comparator to be invoked, when the main comparison
resulted in 0.public AbstractCollationComparator(@Nullable Locale aSortLocale)
aSortLocale - The locale to use. May be null.public AbstractCollationComparator(@Nullable Locale aSortLocale, @Nullable Comparator<? super DATATYPE> aNestedComparator)
aSortLocale - The locale to use. May be null.aNestedComparator - The nested comparator to be invoked, when the main comparison
resulted in 0.public AbstractCollationComparator(@Nullable Locale aSortLocale, @Nonnull ESortOrder eSortOrder)
aSortLocale - The locale to use. May be null.eSortOrder - The sort order to use. May not be null.public AbstractCollationComparator(@Nullable Locale aSortLocale, @Nonnull ESortOrder eSortOrder, @Nullable Comparator<? super DATATYPE> aNestedComparator)
aSortLocale - The locale to use. May be null.eSortOrder - The sort order to use. May not be null.aNestedComparator - The nested comparator to be invoked, when the main comparison
resulted in 0.public AbstractCollationComparator(@Nonnull Collator aCollator)
Collator using the default sort orderaCollator - The Collator to use. May not be null.public AbstractCollationComparator(@Nonnull Collator aCollator, @Nullable Comparator<? super DATATYPE> aNestedComparator)
Collator using the default sort order and a nested
comparator.aCollator - The Collator to use. May not be null.aNestedComparator - The nested comparator to be invoked, when the main comparison
resulted in 0.public AbstractCollationComparator(@Nonnull Collator aCollator, @Nonnull ESortOrder eSortOrder)
Collator and sort order.aCollator - The Collator to use. May not be null.eSortOrder - The sort order to use. May not be null.public AbstractCollationComparator(@Nonnull Collator aCollator, @Nonnull ESortOrder eSortOrder, @Nullable Comparator<? super DATATYPE> aNestedComparator)
Collator and sort order and a nested comparator.aCollator - The Collator to use. May not be null.eSortOrder - The sort order to use. May not be null.aNestedComparator - The nested comparator to be invoked, when the main comparison
resulted in 0.@Nullable protected abstract String asString(@Nonnull DATATYPE aObject)
aObject - The object to be converted. May not be null depending
on the elements to be sorted.null.protected final int mainCompare(@Nullable DATATYPE aElement1, @Nullable DATATYPE aElement2)
mainCompare in class AbstractComparator<DATATYPE>aElement1 - First element to compare. No information on the null
status.aElement2 - Second element to compare. No information on the null
status.Copyright © 2006–2015 phloc systems. All rights reserved.