|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.collections15.comparators.ReverseComparator<T>
public class ReverseComparator<T>
Reverses the order of another comparator by reversing the arguments
to its compare method.
Collections.reverseOrder(),
Serialized Form| Constructor Summary | |
|---|---|
ReverseComparator(Comparator<T> comparator)
Creates a comparator that inverts the comparison of the given comparator. |
|
| Method Summary | |
|---|---|
int |
compare(T obj1,
T obj2)
Compares two objects in reverse order. |
boolean |
equals(Object object)
Returns true iff that Object is
is a Comparator whose ordering is known to be
equivalent to mine. |
int |
hashCode()
Implement a hash code for this comparator that is consistent with equals. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReverseComparator(Comparator<T> comparator)
ComparableComparator
for reversing the natural order, as per
Collections.reverseOrder().
comparator - Comparator to reverse| Method Detail |
|---|
public int compare(T obj1,
T obj2)
compare in interface Comparator<T>obj1 - the first object to compareobj2 - the second object to compare
public int hashCode()
equals.
hashCode in class Objectpublic boolean equals(Object object)
true iff that Object is
is a Comparator whose ordering is known to be
equivalent to mine.
This implementation returns true
iff object.getClass()
equals this.getClass(), and the underlying
comparators are equal.
Subclasses may want to override this behavior to remain consistent
with the equals contract.
equals in interface Comparator<T>equals in class Objectobject - the object to compare to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||