Comparator.reversed()
@Deprecated public class InvertibleComparator<T> extends Object implements Comparator<T>, Serializable
Constructor and Description |
---|
InvertibleComparator(Comparator<T> comparator)
Deprecated.
Create an InvertibleComparator that sorts ascending by default.
|
InvertibleComparator(Comparator<T> comparator,
boolean ascending)
Deprecated.
Create an InvertibleComparator that sorts based on the provided order.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(T o1,
T o2)
Deprecated.
|
boolean |
equals(Object other)
Deprecated.
|
int |
hashCode()
Deprecated.
|
void |
invertOrder()
Deprecated.
Invert the sort order: ascending -> descending or
descending -> ascending.
|
boolean |
isAscending()
Deprecated.
Return the sort order: ascending (true) or descending (false).
|
void |
setAscending(boolean ascending)
Deprecated.
Specify the sort order: ascending (true) or descending (false).
|
String |
toString()
Deprecated.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public InvertibleComparator(Comparator<T> comparator)
comparator
- the comparator to decoratepublic InvertibleComparator(Comparator<T> comparator, boolean ascending)
comparator
- the comparator to decorateascending
- the sort order: ascending (true) or descending (false)public void setAscending(boolean ascending)
public boolean isAscending()
public void invertOrder()
public int compare(T o1, T o2)
compare
in interface Comparator<T>
public boolean equals(Object other)
equals
in interface Comparator<T>
equals
in class Object