diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/utils/BaseMathUtils.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/utils/BaseMathUtils.java index 0612bb5ebeaeeb5b30939ff3f65b908794acf9db..6990b4428b98b1e4c71afd8c1895f34b330b7331 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/utils/BaseMathUtils.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/utils/BaseMathUtils.java @@ -32,7 +32,7 @@ import org.apache.commons.lang.math.NumberUtils; * @author diewald * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating YELLOW Hash: 27F367B924A70CBAD1211670F21AED18 + * @ConQAT.Rating YELLOW Hash: B3EA1B4325C6585B186F6ADBA970B9E6 */ public class BaseMathUtils { @@ -195,6 +195,19 @@ public class BaseMathUtils { return false; } + /** + * Predicate whether the given Number is an integer of the types Byte, Short, Integer, Long, + * 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); + } + /** * Creates an {@link ArithmeticException} if an over-/underflow occurs when converting the given * {@code number} to the given {@code targetType}.