Uses of Class
com.google.common.collect.Ordering
Packages that use Ordering
Package
Description
Collection interfaces and implementations, and other utilities for collections.
-
Uses of Ordering in com.google.common.collect
Methods in com.google.common.collect that return OrderingModifier and TypeMethodDescriptionOrdering.allEqual()Returns an ordering which treats all values as equal, indicating "no ordering."Ordering.arbitrary()Deprecated.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.compound(Comparator<? super U> secondaryComparator) Returns an ordering which first uses the orderingthis, but which in the event of a "tie", then delegates tosecondaryComparator.static <T> Ordering<T> Returns an ordering that compares objects according to the order in which they appear in the given list.static <T> Ordering<T> Ordering.explicit(T leastValue, T... remainingValuesInOrder) Returns an ordering that compares objects according to the order in which they are given to this method.Deprecated.no need to use thisOrdering.from(Comparator<T> comparator) Returns an ordering based on an existing comparator instance.Ordering.lexicographical()Returns a new ordering which sorts iterables by comparing corresponding elements pairwise until a nonzero result is found; imposes "dictionary order".static <C extends Comparable>
Ordering<C> Ordering.natural()Returns a serializable ordering that uses the natural order of the values.Ordering.nullsFirst()Returns an ordering that treatsnullas less than all other values and usesthisto compare non-null values.Ordering.nullsLast()Returns an ordering that treatsnullas greater than all other values and uses this ordering to compare non-null values.Ordering.onResultOf(Function<F, ? extends T> function) Returns a new ordering onFwhich orders elements by first applying a function to them, then comparing those results usingthis.Ordering.reverse()Returns the reverse of this ordering; theOrderingequivalent toCollections.reverseOrder(Comparator).Ordering.usingToString()Returns an ordering that compares objects by the natural ordering of their string representations as returned bytoString().Methods in com.google.common.collect with parameters of type Ordering
Object, and its tie-breaking logic will throwIdentityExceptionon value objects (JEP 401) whose hash codes collide.