public class ComparableUtil
extends java.lang.Object
Comparable
.Constructor and Description |
---|
ComparableUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canConvertToBigDecimal(double value)
Checks if specified double value can be converted to
BigDecimal . |
static boolean |
canConvertToByte(double value)
Checks if specified double value can be converted to byte.
|
static boolean |
canConvertToDate(double value)
Checks if specified double value can be converted to
Date . |
static boolean |
canConvertToFloat(double value)
Checks if specified double value can be converted to float.
|
static boolean |
canConvertToInteger(double value)
Checks if specified double value can be converted to int.
|
static boolean |
canConvertToLong(double value)
Checks if specified double value can be converted to long.
|
static boolean |
canConvertToShort(double value)
Checks if specified double value can be converted to short.
|
static <T extends java.lang.Comparable<T>> |
compare(T a,
T b)
Compares two
Comparable values. |
static <T extends java.lang.Comparable<T>> |
fromDouble(double rawDataValue,
java.lang.Class<T> type)
Converts double value to specified Comparable type.
|
static boolean |
isDefined(byte arg)
Checks if specified argument is defined.
|
static boolean |
isDefined(java.lang.Comparable comparable)
Checks if specified argument is defined.
|
static boolean |
isDefined(java.util.Date arg)
Checks if specified argument is defined.
|
static boolean |
isDefined(double arg)
Checks if specified argument is defined.
|
static boolean |
isDefined(float arg)
Checks if specified argument is defined.
|
static boolean |
isDefined(int arg)
Checks if specified argument is defined.
|
static boolean |
isDefined(long arg)
Checks if specified argument is defined.
|
static boolean |
isDefined(short arg)
Checks if specified argument is defined.
|
static <T extends java.lang.Comparable<T>> |
max(T value1,
T value2)
Gets bigger of two
Comparable values. |
static <T extends java.lang.Comparable<T>> |
min(T value1,
T value2)
Gets smaller of two
Comparable values. |
static java.util.Date |
toDate(java.lang.Comparable comparable)
Converts comparable to its
Date representation. |
static java.util.Date |
toDate(double value)
Converts double to its
Date representation |
static double |
toDouble(java.lang.Comparable comparable)
Converts comparable to its double representation.
|
static double |
toDouble(double value)
Converts value to its double representation.
|
public static boolean isDefined(double arg)
arg
- The argument to check.public static boolean isDefined(float arg)
arg
- The argument to check.public static boolean isDefined(int arg)
arg
- The argument to check.public static boolean isDefined(short arg)
arg
- The argument to check.public static boolean isDefined(byte arg)
arg
- The argument to check.public static boolean isDefined(long arg)
arg
- The argument to check.public static boolean isDefined(java.util.Date arg)
arg
- The argument to check.public static boolean canConvertToFloat(double value)
value
- The value to check.public static boolean canConvertToLong(double value)
value
- The value to check.public static boolean canConvertToInteger(double value)
value
- The value to check.public static boolean canConvertToShort(double value)
value
- The value to check.public static boolean canConvertToByte(double value)
value
- The value to check.public static boolean canConvertToDate(double value)
Date
.value
- The value to check.Date
.public static boolean canConvertToBigDecimal(double value)
BigDecimal
.value
- The value to check.BigDecimal
.public static double toDouble(java.lang.Comparable comparable)
comparable
- The comparable to convert.public static double toDouble(double value)
value
- The value to convert.public static java.util.Date toDate(java.lang.Comparable comparable)
Date
representation.comparable
- The comparable to convert.Date
representation of the value.public static java.util.Date toDate(double value)
Date
representationvalue
- The double value to convertDate
representation of the double valuepublic static boolean isDefined(java.lang.Comparable comparable)
comparable
- The argument to check.public static <T extends java.lang.Comparable<T>> T fromDouble(double rawDataValue, java.lang.Class<T> type)
T
- The target type.rawDataValue
- The double value to convert.type
- The type of target to convert to.public static <T extends java.lang.Comparable<T>> T min(T value1, T value2)
Comparable
values.T
- The type of values.value1
- The first argument.value2
- The second argument.public static <T extends java.lang.Comparable<T>> T max(T value1, T value2)
Comparable
values.T
- The type of values.value1
- The first argument.value2
- The second argument.public static <T extends java.lang.Comparable<T>> int compare(T a, T b)
Comparable
values.T
- The type of values.a
- The first argument.b
- The second argument.