DATATYPE - The type of elements to be compared.@NotThreadSafe public class CollatingComparatorDisplayTextProvider<DATATYPE> extends AbstractCollatingComparator<DATATYPE>
Comparator for objects that implement
the IDisplayTextProvider interface.| Constructor and Description |
|---|
CollatingComparatorDisplayTextProvider(Collator aCollator,
IDisplayTextProvider<DATATYPE> aDisplayTextProvider,
Locale aContentLocale)
Constructor.
|
CollatingComparatorDisplayTextProvider(Locale aSortLocale,
IDisplayTextProvider<DATATYPE> aDisplayTextProvider,
Locale aContentLocale)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Locale |
getContentLocale() |
IDisplayTextProvider<DATATYPE> |
getDisplayTextProvider() |
protected String |
getPart(DATATYPE aObject)
Implement this method to extract the part to compare from the original
object.
|
getCollatorgetPartComparator, mainCompare, toStringcompare, getNestedComparator, getSortOrder, isNullValuesComeFirst, setNestedComparator, setNullValuesComeFirst, setSortOrderclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequalspublic CollatingComparatorDisplayTextProvider(@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 CollatingComparatorDisplayTextProvider(@Nullable Collator aCollator, @Nonnull IDisplayTextProvider<DATATYPE> aDisplayTextProvider, @Nonnull Locale aContentLocale)
aCollator - The Collator to use. May not 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.@Nonnull public IDisplayTextProvider<DATATYPE> getDisplayTextProvider()
null.@Nonnull public Locale getContentLocale()
null.protected String getPart(@Nonnull DATATYPE aObject)
AbstractPartComparatorgetPart in class AbstractPartComparator<DATATYPE,String>aObject - The object to be compared. Never null.null.Copyright © 2014–2015 Philip Helger. All rights reserved.