Comparator
.
Modifier and Type | Class and Description |
---|---|
pack-priv static enum | Comparators.
Compares |
pack-priv static class |
Access | Constructor and Description |
---|---|
private |
Comparators | back to summary |
---|---|
private Comparators() |
Comparable
objects in natural order.
Comparable
Modifier and Type | Field and Description |
---|---|
public static final Comparators. |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public int | compare(Comparable<Object>
the first object to be compared. c1, Comparable<Object> the second object to be compared. c2)Implements java. Compares its two arguments for order. |
public Comparator | reversed()
Overrides default java. Returns a comparator that imposes the reverse ordering of this comparator. |
public static Comparators. | |
public static Comparators. |
INSTANCE | back to summary |
---|---|
public static final Comparators. |
NaturalOrderComparator | back to summary |
---|---|
private NaturalOrderComparator() |
compare | back to summary |
---|---|
public int compare(Comparable<Object> c1, Comparable<Object> c2) 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
|
reversed | back to summary |
---|---|
public Comparator Overrides default java. Doc from java. Returns a comparator that imposes the reverse ordering of this comparator.
|
valueOf | back to summary |
---|---|
public static Comparators. |
values | back to summary |
---|---|
public static Comparators. |
Modifier and Type | Field and Description |
---|---|
private final boolean | |
private final Comparator | |
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. a, T the second object to be compared. b)Implements java. Compares its two arguments for order. |
public Comparator | reversed()
Overrides default java. Returns a comparator that imposes the reverse ordering of this comparator. |
public Comparator | thenComparing(Comparator<? super T>
the other comparator to be used when this comparator
compares two objects that are equal. other)Overrides default java. Returns a lexicographic-order comparator with another comparator. |
nullFirst | back to summary |
---|---|
private final boolean nullFirst |
real | back to summary |
---|---|
private final Comparator<T> real
|
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID
|
NullComparator | back to summary |
---|---|
pack-priv NullComparator(boolean nullFirst, Comparator<? super T> real)
|
compare | back to summary |
---|---|
public int compare(T a, T b) 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
|
reversed | back to summary |
---|---|
public Comparator Overrides default java. Doc from java. Returns a comparator that imposes the reverse ordering of this comparator.
|
thenComparing | back to summary |
---|---|
public Comparator Overrides default java. Doc from java. Returns a lexicographic-order comparator with another comparator.
If this The returned comparator is serializable if the specified comparator is also serializable.
|