| Package | Description |
|---|---|
| com.google.common.collect |
This package contains generic collection interfaces and implementations, and other utilities for working with collections.
|
| Modifier and Type | Method and Description |
|---|---|
static Ordering |
Ordering.allEqual()
Returns an ordering which treats all values as equal, indicating "no ordering." Passing this ordering to any
stable sort algorithm results in no change to the order of elements.
|
static Ordering |
Ordering.arbitrary()
Returns an arbitrary ordering over all objects, for which
compare(a, b) == 0 implies
a == b (identity equality).
|
<U extends T> Ordering |
Ordering.compound(Comparator
Returns an ordering which first uses the ordering
this, but which in the event of a "tie", then delegates to
secondaryComparator.
|
static <T> Ordering |
Ordering.compound(Iterable
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.
|
static <T> Ordering |
Ordering.explicit(List
Returns an ordering that compares objects according to the order in which they appear in the given list.
|
static <T> Ordering |
Ordering.explicit(T leastValue, T... remainingValuesInOrder)
Returns an ordering that compares objects according to the order in which they are given to this method.
|
static <T> Ordering |
Ordering.from(Comparator
Returns an ordering based on an
existing comparator instance.
|
static <T> Ordering |
Ordering.from(Ordering
Deprecated.
no need to use this
|
<S extends T> Ordering |
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.natural()
Returns a serializable ordering that uses the natural order of the values.
|
<S extends T> Ordering |
Ordering.nullsFirst()
Returns an ordering that treats
null as less than all other values and uses
this to compare non-null values.
|
<S extends T> Ordering |
Ordering.nullsLast()
Returns an ordering that treats
null as greater than all other values and uses this ordering to compare non-null values.
|
<F> Ordering |
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.
|
<S extends T> Ordering |
Ordering.reverse()
Returns the reverse of this ordering; the
Ordering equivalent to
Collections.
|
static Ordering |
Ordering.usingToString()
Returns an ordering that compares objects by the natural ordering of their string representations as returned by
toString().
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Ordering |
Ordering.from(Ordering
Deprecated.
no need to use this
|