Skip to content
Snippets Groups Projects
Commit 6fa0ea5e authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Merge remote-tracking branch 'origin/master' into 3994

parents 5d44813a b9505765
No related branches found
No related tags found
1 merge request!115CLI for shutting down the platform
AngleUtils.java 462551eae71738ff51f92c9906bff9a21a375d2b GREEN
AnnotationUtils.java 197ceb5f39af6b96eb8f7025e3fe3b1b39c35d42 GREEN
BaseMathUtils.java 65f6c39b641cba3c984a38f42b1bbf7dbf3287a3 GREEN
BaseMathUtils.java 90712a1560f5b4cb9b7873a148303c970ded756d GREEN
BaseModelElementUtils.java b8775b7a462efc168cf79a017aa3377a782d10f6 GREEN
DimensionUtils.java 0dc67f9de11a84e6e4c6e1eb627817dee91ff30a GREEN
EllipseLayoutUtils.java 5c3a0126fdca5d5b4fb441694747e1cb0f49cd9f GREEN
......
......@@ -194,16 +194,56 @@ public class BaseMathUtils {
}
/**
* Predicate whether the given Number is an integer of the types Byte, Short, Integer, Long,
* BigInteger.
* Predicate whether the given Number is an integer of the types Byte, Short, Integer,
* Long, or BigInteger.
*
* @param value
* Number to test.
* @return boolean if the given Number is an integer number.
*/
public static boolean isIntegerNumber(Number value) {
return(value instanceof Byte || value instanceof Short || value instanceof Integer ||
value instanceof Long || value instanceof BigInteger);
return value != null && isIntegerNumber(value.getClass());
}
/**
* Predicate whether the given Number type is an integer of the types Byte, Short, Integer,
* Long, or BigInteger.
*
* @param valueType
* Type of the number to test.
* @return boolean if the given Number is an integer number.
*/
public static boolean isIntegerNumber(Class<?> valueType) {
return Byte.class.isAssignableFrom(valueType) || Short.class.isAssignableFrom(valueType) ||
Integer.class.isAssignableFrom(valueType) ||
Long.class.isAssignableFrom(valueType) ||
BigInteger.class.isAssignableFrom(valueType);
}
/**
* Predicate whether the given Number type is an integer of the types Float, Double, or
* BigInteger.
*
* @param value
* Number to test.
* @return boolean if the given number is an floating point number.
*/
public static boolean isFloatNumber(Number value) {
return value != null && isFloatNumber(value.getClass());
}
/**
* Predicate whether the given Number type is an integer of the types Float, Double, or
* BigInteger.
*
* @param valueType
* Type of the number to test.
* @return boolean if the given number type is an integer number.
*/
public static boolean isFloatNumber(Class<?> valueType) {
return Float.class.isAssignableFrom(valueType) ||
Double.class.isAssignableFrom(valueType) ||
BigDecimal.class.isAssignableFrom(valueType);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment