public enum SelfComparator extends Enum<SelfComparator> implements Comparator<Comparable>
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Comparable o1,
Comparable o2) |
static <T extends Comparable<? super T>> |
instance() |
static SelfComparator |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SelfComparator[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic static final SelfComparator INSTANCE
public static SelfComparator[] values()
for (SelfComparator c : SelfComparator.values()) System.out.println(c);
public static SelfComparator valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static <T extends Comparable<? super T>> Comparator<T> instance()
public int compare(Comparable o1, Comparable o2)
compare in interface Comparator<Comparable>