compare method.
java.util.Collections#reverseOrder()
| Modifier and Type | Field and Description |
|---|---|
| private final Comparator | comparator
The comparator being decorated. |
| private static final long | serialVersionUID
Serialization version from Collections 2.0. |
| Access | Constructor and Description |
|---|---|
| public | ReverseComparator()
Creates a comparator that compares objects based on the inverse of their natural ordering. |
| public | ReverseComparator(final Comparator<? super E>
Comparator to reverse comparator)Creates a comparator that inverts the comparison of the given comparator. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: negative if obj1 is less, positive if greater, zero if equalthe first object to compare obj1, final E the second object to compare obj2)Implements java. |
| public boolean | Returns: true if equalthe object to compare to object)Overrides java. Implements java. true iff that Object is
is a Comparator whose ordering is known to be
equivalent to mine.
|
| public int | Returns: a suitable hash codeOverrides java. equals.
|
| comparator | back to summary |
|---|---|
| private final Comparator<? super E> comparator The comparator being decorated. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serialization version from Collections 2.0. | |
| ReverseComparator | back to summary |
|---|---|
| public ReverseComparator() Creates a comparator that compares objects based on the inverse of their natural ordering. Using this Constructor will create a ReverseComparator that is functionally identical to the Comparator returned by java.util.Collections.reverseOrder().
| |
| ReverseComparator | back to summary |
|---|---|
| public ReverseComparator(final Comparator<? super E> comparator) Creates a comparator that inverts the comparison
of the given comparator. If you pass in
| |
| compare | back to summary |
|---|---|
| public int compare(final E obj1, final E obj2) Implements java. Compares two objects in reverse order.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object object) Overrides java. Implements java. Returns
This implementation returns | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implement a hash code for this comparator that is consistent with
| |