IDTYPE - The type of the IDDATATYPE - The type of elements to be compared.@NotThreadSafe public class ComparatorHasID<IDTYPE,DATATYPE extends IHasID<IDTYPE>> extends AbstractPartComparator<DATATYPE,IDTYPE>
Comparator for objects that implement the
IHasID interface with a class that does NOT implements
Comparable.| Constructor and Description |
|---|
ComparatorHasID(Comparator<? super IDTYPE> aIDComparator)
Comparator with default sort order and no nested comparator.
|
| Modifier and Type | Method and Description |
|---|---|
protected IDTYPE |
getPart(DATATYPE aObject)
Implement this method to extract the part to compare from the original
object.
|
getPartComparator, mainCompare, toStringcompare, getNestedComparator, getSortOrder, isNullValuesComeFirst, setNestedComparator, setNullValuesComeFirst, setSortOrderclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic ComparatorHasID(@Nonnull Comparator<? super IDTYPE> aIDComparator)
aIDComparator - The comparator for comparing the IDs. May not be null.@Nonnull protected IDTYPE getPart(@Nonnull DATATYPE aObject)
AbstractPartComparatorCopyright © 2014–2015 Philip Helger. All rights reserved.