| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final NaturalOrdering | |
| private transient Ordering | |
| private transient Ordering | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | compare(Comparable<?>
the first object to be compared. left, Comparable<?> the second object to be compared. right)Implements abstract com. Implements java. |
| public <S extends Comparable | nullsFirst()
Overrides com. null as less than all other values and uses this to compare non-null values.
|
| public <S extends Comparable | nullsLast()
Overrides com. null as greater than all other values and uses this
ordering to compare non-null values.
|
| private Object | |
| public <S extends Comparable | reverse()
Overrides com. Ordering equivalent to Collections#reverseOrder(Comparator).
|
| public String |
| INSTANCE | back to summary |
|---|---|
| pack-priv static final NaturalOrdering INSTANCE | |
| nullsFirst | back to summary |
|---|---|
| private transient Ordering<@Nullable Comparable<?>> nullsFirst
| |
| nullsLast | back to summary |
|---|---|
| private transient Ordering<@Nullable Comparable<?>> nullsLast
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| NaturalOrdering | back to summary |
|---|---|
| private NaturalOrdering() | |
| compare | back to summary |
|---|---|
| public int compare(Comparable<?> left, Comparable<?> 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
| |
| nullsFirst | back to summary |
|---|---|
| public <S extends Comparable 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 Comparable Overrides com. Doc from com. Returns an ordering that treats The returned object is serializable if this object is serializable. Java 8 users: Use
| |
| readResolve | back to summary |
|---|---|
| private Object readResolve() | |
| reverse | back to summary |
|---|---|
| public <S extends Comparable 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. | |