Package org.apache.cassandra.utils
Class Comparables
- java.lang.Object
-
- org.apache.cassandra.utils.Comparables
-
public class Comparables extends java.lang.Object
Utility methods linked to comparing comparable values.
-
-
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 a, T b)
Returns the maximum of 2 comparable values.static <C,T extends C>
Tmax(T a, T b, java.util.Comparator<C> comparator)
Returns the maximum of 2 values given a comparator of those values.static <T extends java.lang.Comparable<? super T>>
Tmin(T a, T b)
Returns the minimum of 2 comparable values.static <C,T extends C>
Tmin(T a, T b, java.util.Comparator<C> comparator)
Returns the minimum of 2 values given a comparator of those values.
-
-
-
Method Detail
-
max
public static <T extends java.lang.Comparable<? super T>> T max(T a, T b)
Returns the maximum of 2 comparable values. On ties, returns the first argument.
-
max
public static <C,T extends C> T max(T a, T b, java.util.Comparator<C> comparator)
Returns the maximum of 2 values given a comparator of those values. On ties, returns the first argument.
-
min
public static <T extends java.lang.Comparable<? super T>> T min(T a, T b)
Returns the minimum of 2 comparable values. On ties, returns the first argument.
-
min
public static <C,T extends C> T min(T a, T b, java.util.Comparator<C> comparator)
Returns the minimum of 2 values given a comparator of those values. On ties, returns the first argument.
-
-