DATATYPE - The type of elements to be compared.public final class ComparatorDisplayTextProvider<DATATYPE> extends AbstractCollationComparator<DATATYPE>
Comparator for objects that implement
the IDisplayTextProvider interface.| Constructor and Description |
|---|
ComparatorDisplayTextProvider(Locale aSortLocale,
IDisplayTextProvider<DATATYPE> aDisplayTextProvider,
Locale aContentLocale)
Constructor.
|
ComparatorDisplayTextProvider(Locale aSortLocale,
IDisplayTextProvider<DATATYPE> aDisplayTextProvider,
Locale aContentLocale,
ESortOrder eSortOrder)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
asString(DATATYPE aObject)
Abstract method that needs to be overridden to convert an object to a
string representation for comparison.
|
Locale |
getContentLocale() |
IDisplayTextProvider<DATATYPE> |
getDisplayTextProvider() |
mainCompare, toStringcompare, getSortOrder, setSortOrderclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequalspublic ComparatorDisplayTextProvider(@Nullable Locale aSortLocale, @Nonnull IDisplayTextProvider<DATATYPE> aDisplayTextProvider, @Nonnull Locale aContentLocale)
aSortLocale - The locale to be used for sorting. May be null.aDisplayTextProvider - The display text provider to be used. May not be null.aContentLocale - The locale to be used to retrieve the display text of an object. May
not be null.public ComparatorDisplayTextProvider(@Nullable Locale aSortLocale, @Nonnull IDisplayTextProvider<DATATYPE> aDisplayTextProvider, @Nonnull Locale aContentLocale, @Nonnull ESortOrder eSortOrder)
aSortLocale - The locale to be used for sorting. May be null.aDisplayTextProvider - The display text provider to be used. May not be null.aContentLocale - The locale to be used to retrieve the display text of an object. May
not be null.eSortOrder - The sort order to be used. May not be null.@Nonnull public IDisplayTextProvider<DATATYPE> getDisplayTextProvider()
protected String asString(DATATYPE aObject)
AbstractCollationComparatorasString in class AbstractCollationComparator<DATATYPE>aObject - The object to be converted. May not be null depending
on the elements to be sorted.null.Copyright © 2006–2014 phloc systems. All rights reserved.