final class ReverseNaturalOrdering extends Ordering<java.lang.Comparable<?>> implements java.io.Serializable
Ordering.ArbitraryOrdering, Ordering.IncomparableValueException| Modifier and Type | Field and Description |
|---|---|
(package private) static ReverseNaturalOrdering |
INSTANCE |
private static long |
serialVersionUID |
LEFT_IS_GREATER, RIGHT_IS_GREATER| Modifier | Constructor and Description |
|---|---|
private |
ReverseNaturalOrdering() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(java.lang.Comparable<?> left,
java.lang.Comparable<?> right) |
<E extends java.lang.Comparable<?>> |
max(E a,
E b)
Returns the greater of the two values according to this ordering.
|
<E extends java.lang.Comparable<?>> |
max(E a,
E b,
E c,
E... rest)
Returns the greatest of the specified values according to this ordering.
|
<E extends java.lang.Comparable<?>> |
max(java.lang.Iterable<E> iterable)
Returns the greatest of the specified values according to this ordering.
|
<E extends java.lang.Comparable<?>> |
max(java.util.Iterator<E> iterator)
Returns the greatest of the specified values according to this ordering.
|
<E extends java.lang.Comparable<?>> |
min(E a,
E b)
Returns the lesser of the two values according to this ordering.
|
<E extends java.lang.Comparable<?>> |
min(E a,
E b,
E c,
E... rest)
Returns the least of the specified values according to this ordering.
|
<E extends java.lang.Comparable<?>> |
min(java.lang.Iterable<E> iterable)
Returns the least of the specified values according to this ordering.
|
<E extends java.lang.Comparable<?>> |
min(java.util.Iterator<E> iterator)
Returns the least of the specified values according to this ordering.
|
private java.lang.Object |
readResolve() |
<S extends java.lang.Comparable<?>> |
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, usingToStringstatic final ReverseNaturalOrdering INSTANCE
private static final long serialVersionUID
public int compare(java.lang.Comparable<?> left,
java.lang.Comparable<?> right)
public <S extends java.lang.Comparable<?>> Ordering<S> reverse()
OrderingOrdering equivalent to Collections.reverseOrder(Comparator).
Java 8 users: Use thisComparator.reversed() instead.
public <E extends java.lang.Comparable<?>> 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.
Note: Consider using Comparators.min(a, b, thisComparator) instead. If thisComparator is Ordering.natural(), then use Comparators.min(a, b).
public <E extends java.lang.Comparable<?>> E min(E a,
E b,
E c,
E... rest)
OrderingJava 8 users: Use Collections.min(Arrays.asList(a, b, c...), thisComparator)
instead (but note that it does not guarantee which tied minimum element is returned).
public <E extends java.lang.Comparable<?>> E min(java.util.Iterator<E> iterator)
OrderinghasNext() method will return false.
Java 8 users: Use Streams.stream(iterator).min(thisComparator).get() instead
(but note that it does not guarantee which tied minimum element is returned).
public <E extends java.lang.Comparable<?>> E min(java.lang.Iterable<E> iterable)
OrderingJava 8 users: If iterable is a Collection, use Collections.min(collection, thisComparator) instead. Otherwise, use Streams.stream(iterable).min(thisComparator).get() instead. Note that these alternatives do
not guarantee which tied minimum element is returned)
public <E extends java.lang.Comparable<?>> 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.
Note: Consider using Comparators.max(a, b, thisComparator) instead. If thisComparator is Ordering.natural(), then use Comparators.max(a, b).
public <E extends java.lang.Comparable<?>> E max(E a,
E b,
E c,
E... rest)
OrderingJava 8 users: Use Collections.max(Arrays.asList(a, b, c...), thisComparator)
instead (but note that it does not guarantee which tied maximum element is returned).
public <E extends java.lang.Comparable<?>> E max(java.util.Iterator<E> iterator)
OrderinghasNext() method will return false.
Java 8 users: Use Streams.stream(iterator).max(thisComparator).get() instead
(but note that it does not guarantee which tied maximum element is returned).
public <E extends java.lang.Comparable<?>> E max(java.lang.Iterable<E> iterable)
OrderingJava 8 users: If iterable is a Collection, use Collections.max(collection, thisComparator) instead. Otherwise, use Streams.stream(iterable).max(thisComparator).get() instead. Note that these alternatives do
not guarantee which tied maximum element is returned)
private java.lang.Object readResolve()
public java.lang.String toString()
toString in class java.lang.Object