@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).
Java 8 users: Use thisComparator.reversed() instead.
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.
Java 8 users: Use Stream.of(a, b).min(thisComparator).get() instead (but note
that it does not guarantee which tied minimum element is returned).
public <E extends T> E min(E a, E b, E c, E... rest)
OrderingJava 8 users: Use Stream.of(a, b, c...).min(thisComparator).get() instead
(but note that it does not guarantee which tied minimum element is returned).
public <E extends T> E min(java.util.Iterator<E> iterator)
OrderinghasNext() method will return false.
Java 8 users: Continue to use this method for now. After the next release of Guava,
use Streams.stream(iterator).min(thisComparator).get() instead (but note that it does
not guarantee which tied minimum element is returned).
public <E extends T> E min(java.lang.Iterable<E> iterable)
OrderingJava 8 users: If iterable is a Collection, use Collections.min(collection, thisComparator) instead. Otherwise, continue to use this method
for now. After the next release of Guava, use Streams.stream(iterable).min(thisComparator).get() instead. Note that these alternatives do
not guarantee which tied minimum element is returned)
public <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.
Java 8 users: Use Stream.of(a, b).max(thisComparator).get() instead (but note
that it does not guarantee which tied maximum element is returned).
public <E extends T> E max(E a, E b, E c, E... rest)
OrderingJava 8 users: Use Stream.of(a, b, c...).max(thisComparator).get() instead
(but note that it does not guarantee which tied maximum element is returned).
public <E extends T> E max(java.util.Iterator<E> iterator)
OrderinghasNext() method will return false.
Java 8 users: Continue to use this method for now. After the next release of Guava,
use Streams.stream(iterator).max(thisComparator).get() instead (but note that it does
not guarantee which tied maximum element is returned).
public <E extends T> E max(java.lang.Iterable<E> iterable)
OrderingJava 8 users: If iterable is a Collection, use Collections.max(collection, thisComparator) instead. Otherwise, continue to use this method
for now. After the next release of Guava, use Streams.stream(iterable).max(thisComparator).get() instead. Note that these alternatives do
not guarantee which tied maximum element is returned)
public 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