T - the generic type of the comparing objectpublic class SortOrderComparator<T extends Comparable<T>> extends Object implements Comparator<T>, Serializable
SortOrderComparator can add a sort order ascending or descending. The default
sort order is ascending.| Modifier and Type | Field and Description |
|---|---|
static SortOrder |
DEFAULT_SORT_ORDER
The constant default sort order.
|
| Constructor and Description |
|---|
SortOrderComparator()
Instantiates a new
SortOrderComparator with the default sort order. |
SortOrderComparator(SortOrder sortOrder)
Instantiates a new
SortOrderComparator with the given sort order. |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(T object,
T compareWithObject) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic static final SortOrder DEFAULT_SORT_ORDER
public SortOrderComparator()
SortOrderComparator with the default sort order.public SortOrderComparator(SortOrder sortOrder)
SortOrderComparator with the given sort order.sortOrder - the sort orderpublic int compare(T object, T compareWithObject)
compare in interface Comparator<T extends Comparable<T>>Copyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.