Package com.google.common.collect
Class NullsLastOrdering<T>
java.lang.Object
com.google.common.collect.Ordering<T>
com.google.common.collect.NullsLastOrdering<T>
- All Implemented Interfaces:
Serializable,Comparator<T>
An ordering that treats
null as greater than all other values.-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.common.collect.Ordering
Ordering.ArbitraryOrdering, Ordering.IncomparableValueException -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longFields inherited from class com.google.common.collect.Ordering
LEFT_IS_GREATER, RIGHT_IS_GREATER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleaninthashCode()Returns an ordering that treatsnullas less than all other values and usesthisto compare non-null values.Returns an ordering that treatsnullas greater than all other values and uses this ordering to compare non-null values.reverse()Returns the reverse of this ordering; theOrderingequivalent toCollections.reverseOrder(Comparator).toString()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, onKeys, onResultOf, sortedCopy, usingToStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
ordering
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
NullsLastOrdering
-
-
Method Details
-
compare
-
reverse
Description copied from class:OrderingReturns the reverse of this ordering; theOrderingequivalent toCollections.reverseOrder(Comparator).Java 8 users: Use
thisComparator.reversed()instead. -
nullsFirst
Description copied from class:OrderingReturns an ordering that treatsnullas less than all other values and usesthisto compare non-null values.The returned object is serializable if this object is serializable.
Java 8 users: Use
Comparator.nullsFirst(thisComparator)instead.- Overrides:
nullsFirstin classOrdering<T>
-
nullsLast
Description copied from class:OrderingReturns an ordering that treatsnullas greater than all other values and uses this ordering to compare non-null values.The returned object is serializable if this object is serializable.
Java 8 users: Use
Comparator.nullsLast(thisComparator)instead. -
equals
- Specified by:
equalsin interfaceComparator<T>- Overrides:
equalsin classObject
-
hashCode
public int hashCode() -
toString
-