Package org.midheaven.lang
Class Comparables
java.lang.Object
org.midheaven.lang.Comparables
Represents Comparables.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> intcompare(Comparator<T> comparator, T a, T b) Performs compare.static <T extends Comparable<T>>
intcompare(T a, T b) Performs compare.static <T extends Comparable<T>>
Maybe<T> Performs max.static <T> Maybe<T> max(Comparator<T> comparator, Iterable<T> elements) Performs max.static <T> Tmax(Comparator<T> comparator, T a, T b, T... others) Performs max.static <T extends Comparable<T>>
Tmax(T a, T b, T... others) Performs max.static <T extends Comparable<T>>
Maybe<T> Performs min.static <T> Maybe<T> min(Comparator<T> comparator, Iterable<T> elements) Performs min.static <T> Tmin(Comparator<T> comparator, T a, T b, T... others) Performs min.static <T extends Comparable<T>>
Tmin(T a, T b, T... others) Performs min.
-
Method Details
-
compare
Performs compare.- Parameters:
a- the a valueb- the b value- Returns:
- the result of compare
-
compare
Performs compare.- Parameters:
comparator- the comparator valuea- the a valueb- the b value- Returns:
- the result of compare
-
min
Performs min.- Parameters:
a- the a valueb- the b valueothers- the others value- Returns:
- the result of min
-
min
Performs min.- Parameters:
comparator- the comparator valuea- the a valueb- the b valueothers- the others value- Returns:
- the result of min
-
min
Performs min.- Parameters:
elements- the elements value- Returns:
- the result of min
-
min
Performs min.- Parameters:
comparator- the comparator valueelements- the elements value- Returns:
- the result of min
-
max
Performs max.- Parameters:
a- the a valueb- the b valueothers- the others value- Returns:
- the result of max
-
max
Performs max.- Parameters:
comparator- the comparator valuea- the a valueb- the b valueothers- the others value- Returns:
- the result of max
-
max
Performs max.- Parameters:
elements- the elements value- Returns:
- the result of max
-
max
Performs max.- Parameters:
comparator- the comparator valueelements- the elements value- Returns:
- the result of max
-