Java com.google.common.collect Ordering fields, constructors, methods, implement or subclass

Example usage for Java com.google.common.collect Ordering fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.google.common.collect Ordering.

The text is from its open source code.

Subclass

com.google.common.collect.Ordering has subclasses.
Click this link to see all its subclasses.

Constructor

Ordering()
Constructs a new instance of this class (only invokable by the subclass constructor, typically implicit).

Method

OrderingallEqual()
Returns an ordering which treats all values as equal, indicating "no ordering."
Orderingarbitrary()
Returns an arbitrary ordering over all objects, for which compare(a, b) == 0 implies a == b (identity equality).
intbinarySearch(List sortedList, @Nullable T key)
Collections#binarySearch(List,Object,Comparator) Searches sortedList for key using the binary search algorithm.
intcompare(@Nullable T left, @Nullable T right)
Orderingcompound(Comparator secondaryComparator)
Returns an ordering which first uses the ordering this , but which in the event of a "tie", then delegates to secondaryComparator .
Orderingcompound(Iterable> 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.
Orderingexplicit(List valuesInOrder)
Returns an ordering that compares objects according to the order in which they appear in the given list.
Orderingfrom(Comparator comparator)
Returns an ordering based on an existing comparator instance.
Orderingfrom(Ordering ordering)
Simply returns its argument.
ListgreatestOf(Iterable iterable, int k)
Returns the k greatest elements of the given iterable according to this ordering, in order from greatest to least.
ListgreatestOf(Iterator iterator, int k)
Returns the k greatest elements from the given iterator according to this ordering, in order from greatest to least.
ImmutableListimmutableSortedCopy(Iterable elements)
Returns an immutable list containing elements sorted by this ordering.
booleanisOrdered(Iterable 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.
ListleastOf(Iterable iterable, int k)
Returns the k least elements of the given iterable according to this ordering, in order from least to greatest.
ListleastOf(Iterator elements, int k)
Returns the k least elements from the given iterator according to this ordering, in order from least to greatest.
Emax(Iterator iterator)
Returns the greatest of the specified values according to this ordering.
Emax(Iterable iterable)
Returns the greatest of the specified values according to this ordering.
Emax(@Nullable E a, @Nullable E b)
Returns the greater of the two values according to this ordering.
Emin(Iterator iterator)
Returns the least of the specified values according to this ordering.
Emin(Iterable iterable)
Returns the least of the specified values according to this ordering.
Emin(@Nullable E a, @Nullable E b)
Returns the lesser of the two values according to this ordering.
Orderingnatural()
Returns a serializable ordering that uses the natural order of the values.
OrderingnullsFirst()
Returns an ordering that treats null as less than all other values and uses this to compare non-null values.
OrderingnullsLast()
Returns an ordering that treats null as greater than all other values and uses this ordering to compare non-null values.
OrderingonResultOf(Function function)
Returns a new ordering on F which orders elements by first applying a function to them, then comparing those results using this .
Orderingreverse()
Returns the reverse of this ordering; the Ordering equivalent to Collections#reverseOrder(Comparator) .
ListsortedCopy(Iterable elements)
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 .
StringtoString()
Returns a string representation of the object.
OrderingusingToString()
Returns an ordering that compares objects by the natural ordering of their string representations as returned by toString() .