Package com.yahoo.collections
Class Comparables
- java.lang.Object
-
- com.yahoo.collections.Comparables
-
public class Comparables extends java.lang.Object
Utilities forComparable
classes.- Author:
- hakon
-
-
Constructor Summary
Constructors Constructor Description Comparables()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends java.lang.Comparable<? super T>>
Tmax(T first, T second)
Returns the least element, orsecond
if they are equal according tocompareTo
.static <T extends java.lang.Comparable<? super T>>
Tmin(T first, T second)
Returns the least element, orfirst
if they are equal according tocompareTo
.
-
-
-
Method Detail
-
min
public static <T extends java.lang.Comparable<? super T>> T min(T first, T second)
Returns the least element, orfirst
if they are equal according tocompareTo
.
-
max
public static <T extends java.lang.Comparable<? super T>> T max(T first, T second)
Returns the least element, orsecond
if they are equal according tocompareTo
.
-
-