null as greater than all other values.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Ordering | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | compare(T
the first object to be compared. left, T the second object to be compared. right)Implements abstract com. Implements java. |
| public boolean | equals(Object
the reference object with which to compare. object)Overrides java. Implements java. |
| public int | |
| public <S extends @Nullable T> Ordering | nullsFirst()
Overrides com. null as less than all other values and uses this to compare non-null values.
|
| public <S extends @Nullable T> Ordering | nullsLast()
Overrides com. null as greater than all other values and uses this
ordering to compare non-null values.
|
| public <S extends @Nullable T> Ordering | reverse()
Overrides com. Ordering equivalent to Collections#reverseOrder(Comparator).
|
| public String |
| ordering | back to summary |
|---|---|
| pack-priv final Ordering<? super T> ordering | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| NullsLastOrdering | back to summary |
|---|---|
| pack-priv NullsLastOrdering(Ordering<? super T> ordering) | |
| compare | back to summary |
|---|---|
| public int compare(T left, T right) Implements abstract com. Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Implements java. Doc from java. Indicates whether some other object is "equal to"
this comparator. This method must obey the general contract of
Note that it is always safe not to override
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| nullsFirst | back to summary |
|---|---|
| public <S extends @Nullable T> Ordering Overrides com. Doc from com. Returns an ordering that treats The returned object is serializable if this object is serializable. Java 8+ users: Use
| |
| nullsLast | back to summary |
|---|---|
| public <S extends @Nullable T> Ordering Overrides com. Doc from com. Returns an ordering that treats The returned object is serializable if this object is serializable. Java 8+ users: Use
| |
| reverse | back to summary |
|---|---|
| public <S extends @Nullable T> Ordering Overrides com. Doc from com. Returns the reverse of this ordering; the Java 8+ users: Use
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |