public class ReverseComparator<E> extends Object implements Comparator<E>, Serializable
|Constructor and Description|
Creates a comparator that compares objects based on the inverse of their natural ordering.
Creates a comparator that inverts the comparison of the given comparator.
|Modifier and Type||Method and Description|
Compares two objects in reverse order.
Implement a hash code for this comparator that is consistent with
public ReverseComparator(Comparator<? super E> comparator)
null, the ReverseComparator defaults to reversing the natural order, as per
comparator- Comparator to reverse
public int hashCode()
trueiff that Object is is a
Comparatorwhose ordering is known to be equivalent to mine.
This implementation returns
this.getClass(), and the underlying
comparators are equal.
Subclasses may want to override this behavior to remain consistent
Copyright © 2001–2014 The Apache Software Foundation. All rights reserved.