public enum Comparison extends Enum<Comparison>
Modifier and Type | Method and Description |
---|---|
static <T> Comparison |
compare(Comparator<T> comparator,
T a,
T b)
Returns a Comparison result from the two values using a Comparator.
|
static <T extends Comparable<T>> |
compare(T a,
T b)
Returns a Comparison result from the two given Comparables.
|
static Comparison |
from(int compareToResult)
Returns a Comparison from the given result of a call to
Comparable.compareTo() or Comparator.compare . |
<T> T |
lesserEqualGreater(T lesser,
T equal,
T greater)
Returns the appropriate T based on the Comparison value.
|
static Comparison |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Comparison[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Comparison LESSER
public static final Comparison EQUAL
public static final Comparison GREATER
public static Comparison[] values()
for (Comparison c : Comparison.values()) System.out.println(c);
public static Comparison 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 <T> T lesserEqualGreater(T lesser, T equal, T greater)
public static <T extends Comparable<T>> Comparison compare(T a, T b)
public static <T> Comparison compare(Comparator<T> comparator, T a, T b)
public static Comparison from(int compareToResult)
Comparable.compareTo()
or Comparator.compare
.