Comparator.reversed()
@Deprecated
public class InvertibleComparator<T>
extends java.lang.Object
implements java.util.Comparator<T>, java.io.Serializable
Constructor and Description |
---|
InvertibleComparator(java.util.Comparator<T> comparator)
Deprecated.
Create an InvertibleComparator that sorts ascending by default.
|
InvertibleComparator(java.util.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(java.lang.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).
|
java.lang.String |
toString()
Deprecated.
|
public InvertibleComparator(java.util.Comparator<T> comparator)
comparator
- the comparator to decoratepublic InvertibleComparator(java.util.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 java.util.Comparator<T>
public boolean equals(java.lang.Object other)
equals
in interface java.util.Comparator<T>
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object