Example usage for Java com.google.common.collect Ordering fields, constructors, methods, implement or subclass
The text is from its open source code.
Ordering() Constructs a new instance of this class (only invokable by the subclass constructor, typically implicit). |
Ordering | allEqual() Returns an ordering which treats all values as equal, indicating "no ordering." |
Ordering | arbitrary() Returns an arbitrary ordering over all objects, for which compare(a, b) == 0 implies a == b (identity equality). |
int | binarySearch(List extends T> sortedList, @Nullable T key) Collections#binarySearch(List,Object,Comparator) Searches sortedList for key using the binary search algorithm. |
int | compare(@Nullable T left, @Nullable T right) |
Ordering | compound(Comparator super U> secondaryComparator) Returns an ordering which first uses the ordering this , but which in the event of a "tie", then delegates to secondaryComparator . |
Ordering | compound(Iterable extends Comparator super T>> comparators) Returns an ordering which tries each given comparator in order until a non-zero result is found, returning that result, and returning zero only if all comparators return zero. |
Ordering | explicit(List Returns an ordering that compares objects according to the order in which they appear in the given list. |
Ordering | from(Comparator Returns an ordering based on an existing comparator instance. |
Ordering | from(Ordering Simply returns its argument. |
List | greatestOf(Iterable Returns the k greatest elements of the given iterable according to this ordering, in order from greatest to least. |
List | greatestOf(Iterator Returns the k greatest elements from the given iterator according to this ordering, in order from greatest to least. |
ImmutableList | immutableSortedCopy(Iterable Returns an immutable list containing elements sorted by this ordering. |
boolean | isOrdered(Iterable extends T> iterable) Returns true if each element in iterable after the first is greater than or equal to the element that preceded it, according to this ordering. |
List | leastOf(Iterable Returns the k least elements of the given iterable according to this ordering, in order from least to greatest. |
List | leastOf(Iterator Returns the k least elements from the given iterator according to this ordering, in order from least to greatest. |
E | max(Iterator Returns the greatest of the specified values according to this ordering. |
E | max(Iterable Returns the greatest of the specified values according to this ordering. |
E | max(@Nullable E a, @Nullable E b) Returns the greater of the two values according to this ordering. |
E | min(Iterator Returns the least of the specified values according to this ordering. |
E | min(Iterable Returns the least of the specified values according to this ordering. |
E | min(@Nullable E a, @Nullable E b) Returns the lesser of the two values according to this ordering. |
Ordering | natural() Returns a serializable ordering that uses the natural order of the values. |
Ordering | nullsFirst() Returns an ordering that treats null as less than all other values and uses this to compare non-null values. |
Ordering | nullsLast() Returns an ordering that treats null as greater than all other values and uses this ordering to compare non-null values. |
Ordering | onResultOf(Function Returns a new ordering on F which orders elements by first applying a function to them, then comparing those results using this . |
Ordering | reverse() Returns the reverse of this ordering; the Ordering equivalent to Collections#reverseOrder(Comparator) . |
List | sortedCopy(Iterable Returns a mutable list containing elements sorted by this ordering; use this only when the resulting list may need further modification, or may contain null . |
String | toString() Returns a string representation of the object. |
Ordering | usingToString() Returns an ordering that compares objects by the natural ordering of their string representations as returned by toString() . |