DATATYPE - The type of elements to be compared.PARTTYPE - The part type that is extracted from the data element and comparedpublic abstract class AbstractPartComparator<DATATYPE,PARTTYPE> extends AbstractComparator<DATATYPE>
AbstractComparator that extracts a certain data
element from the main object to compare.| Constructor and Description |
|---|
AbstractPartComparator(Comparator<? super DATATYPE> aNestedComparator,
Comparator<? super PARTTYPE> aPartComparator)
Comparator with default sort order and a nested comparator.
|
AbstractPartComparator(Comparator<? super PARTTYPE> aPartComparator)
Comparator with default sort order and no nested comparator.
|
AbstractPartComparator(ESortOrder eSortOrder,
Comparator<? super DATATYPE> aNestedComparator,
Comparator<? super PARTTYPE> aPartComparator)
Constructor with sort order and a nested comparator.
|
AbstractPartComparator(ESortOrder eSortOrder,
Comparator<? super PARTTYPE> aPartComparator)
Constructor with sort order and no nested comparator.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract PARTTYPE |
getPart(DATATYPE aObject) |
protected int |
mainCompare(DATATYPE aElement1,
DATATYPE aElement2) |
compare, getSortOrder, setSortOrderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequalspublic AbstractPartComparator(@Nonnull Comparator<? super PARTTYPE> aPartComparator)
aPartComparator - The comparator for comparing the IDs. May not be null.public AbstractPartComparator(@Nonnull ESortOrder eSortOrder, @Nonnull Comparator<? super PARTTYPE> aPartComparator)
eSortOrder - The sort order to use. May not be null.aPartComparator - The comparator for comparing the IDs. May not be null.public AbstractPartComparator(@Nullable Comparator<? super DATATYPE> aNestedComparator, @Nonnull Comparator<? super PARTTYPE> aPartComparator)
aNestedComparator - The nested comparator to be invoked, when the main comparison
resulted in 0.aPartComparator - The comparator for comparing the IDs. May not be null.public AbstractPartComparator(@Nonnull ESortOrder eSortOrder, @Nullable Comparator<? super DATATYPE> aNestedComparator, @Nonnull Comparator<? super PARTTYPE> aPartComparator)
eSortOrder - The sort order to use. May not be null.aNestedComparator - The nested comparator to be invoked, when the main comparison
resulted in 0.aPartComparator - The comparator for comparing the IDs. May not be null.protected final int mainCompare(DATATYPE aElement1, 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–2014 phloc systems. All rights reserved.