@GwtCompatible(serializable=true) final class ReverseOrdering<T> extends Ordering<T> implements java.io.Serializable
Ordering.ArbitraryOrdering, Ordering.IncomparableValueException| Modifier and Type | Field and Description |
|---|---|
(package private) Ordering<? super T> |
forwardOrder |
private static long |
serialVersionUID |
LEFT_IS_GREATER, RIGHT_IS_GREATER| Constructor and Description |
|---|
ReverseOrdering(Ordering<? super T> forwardOrder) |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(T a,
T b) |
boolean |
equals(java.lang.Object object) |
int |
hashCode() |
<E extends T> |
max(E a,
E b)
Returns the greater of the two values according to this ordering.
|
<E extends T> |
max(E a,
E b,
E c,
E... rest)
Returns the greatest of the specified values according to this ordering.
|
<E extends T> |
max(java.lang.Iterable<E> iterable)
Returns the greatest of the specified values according to this ordering.
|
<E extends T> |
max(java.util.Iterator<E> iterator)
Returns the greatest of the specified values according to this ordering.
|
<E extends T> |
min(E a,
E b)
Returns the lesser of the two values according to this ordering.
|
<E extends T> |
min(E a,
E b,
E c,
E... rest)
Returns the least of the specified values according to this ordering.
|
<E extends T> |
min(java.lang.Iterable<E> iterable)
Returns the least of the specified values according to this ordering.
|
<E extends T> |
min(java.util.Iterator<E> iterator)
Returns the least of the specified values according to this ordering.
|
<S extends T> |
reverse()
Returns the reverse of this ordering; the
Ordering equivalent to
Collections.reverseOrder(Comparator). |
java.lang.String |
toString() |
allEqual, arbitrary, binarySearch, compound, compound, explicit, explicit, from, from, greatestOf, greatestOf, immutableSortedCopy, isOrdered, isStrictlyOrdered, leastOf, leastOf, lexicographical, natural, nullsFirst, nullsLast, onKeys, onResultOf, sortedCopy, usingToStringprivate static final long serialVersionUID
public <S extends T> Ordering<S> reverse()
OrderingOrdering equivalent to
Collections.reverseOrder(Comparator).public <E extends T> E min(E a, E b)
OrderingImplementation note: this method is invoked by the default
implementations of the other min overloads, so overriding it will
affect their behavior.
public <E extends T> E min(E a, E b, E c, E... rest)
Orderingpublic <E extends T> E min(java.util.Iterator<E> iterator)
OrderinghasNext() method will return
false.public <E extends T> E min(java.lang.Iterable<E> iterable)
Orderingpublic <E extends T> E max(E a, E b)
OrderingImplementation note: this method is invoked by the default
implementations of the other max overloads, so overriding it will
affect their behavior.
public <E extends T> E max(E a, E b, E c, E... rest)
Orderingpublic <E extends T> E max(java.util.Iterator<E> iterator)
OrderinghasNext() method will return
false.public <E extends T> E max(java.lang.Iterable<E> iterable)
Orderingpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(@Nullable
java.lang.Object object)
equals in interface java.util.Comparator<T>equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object