public abstract class Comparing extends Object
| Constructor and Description |
|---|
Comparing() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Comparable<T>> |
max(T lhs,
T rhs)
Evaluates max of two comparable elements.
|
static <T> T |
max(T lhs,
T rhs,
Comparator<T> comparator)
Evaluates max of two elements.
|
static <T extends Comparable<T>> |
min(T lhs,
T rhs)
Evaluates min of two comparable elements.
|
static <T> T |
min(T lhs,
T rhs,
Comparator<T> comparator)
Evaluates min of two elements.
|
static <T extends Comparable<T>> |
ordered(T lhs,
T rhs)
Returns the two comparable elements ordered in a pair.
|
static <T> Pair<T,T> |
ordered(T lhs,
T rhs,
Comparator<T> comparator)
Returns the two elements ordered in a pair.
|
public static <T> T max(T lhs,
T rhs,
Comparator<T> comparator)
T - the element typelhs - the left elementrhs - the right elementcomparator - the comparator used to compare elementspublic static <T extends Comparable<T>> T max(T lhs, T rhs)
T - the element typelhs - the left elementrhs - the right elementpublic static <T> T min(T lhs,
T rhs,
Comparator<T> comparator)
T - the element typelhs - the left elementrhs - the right elementcomparator - the comparator used to compare elementspublic static <T extends Comparable<T>> T min(T lhs, T rhs)
T - the element typelhs - the left elementrhs - the right elementpublic static <T> Pair<T,T> ordered(T lhs, T rhs, Comparator<T> comparator)
T - the element typelhs - the left elementrhs - the right elementcomparator - the comparator used to compare elementspublic static <T extends Comparable<T>> Pair<T,T> ordered(T lhs, T rhs)
T - the element typelhs - the left elementrhs - the right elementCopyright © 2013. All rights reserved.