Package com.google.common.collect
Class ExplicitOrdering<T>
java.lang.Object
com.google.common.collect.Ordering<T>
com.google.common.collect.ExplicitOrdering<T>
- All Implemented Interfaces:
Serializable
,Comparator<T>
An ordering that compares objects according to a given order.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.common.collect.Ordering
Ordering.ArbitraryOrdering, Ordering.IncomparableValueException
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ImmutableMap
<T, Integer> private static final long
Fields inherited from class com.google.common.collect.Ordering
LEFT_IS_GREATER, RIGHT_IS_GREATER
-
Constructor Summary
ConstructorsConstructorDescriptionExplicitOrdering
(ImmutableMap<T, Integer> rankMap) ExplicitOrdering
(List<T> valuesInOrder) -
Method Summary
Methods inherited from class com.google.common.collect.Ordering
allEqual, arbitrary, binarySearch, compound, compound, explicit, explicit, from, from, greatestOf, greatestOf, immutableSortedCopy, isOrdered, isStrictlyOrdered, leastOf, leastOf, lexicographical, max, max, max, max, min, min, min, min, natural, nullsFirst, nullsLast, onKeys, onResultOf, reverse, sortedCopy, usingToString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
rankMap
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
ExplicitOrdering
-
ExplicitOrdering
ExplicitOrdering(ImmutableMap<T, Integer> rankMap)
-
-
Method Details
-
compare
-
rank
-
equals
- Specified by:
equals
in interfaceComparator<T>
- Overrides:
equals
in classObject
-
hashCode
public int hashCode() -
toString
-