From 55076de7ec0667172218c61bf8a5abb2b89e7a37 Mon Sep 17 00:00:00 2001 From: Alexander Diewald <diewald@fortiss.org> Date: Fri, 19 May 2017 15:06:23 +0000 Subject: [PATCH] - Add parser interface for exploration expression language (visitor). This includes an additional EOperation for IExpressions to accept visitors. - Implement a base class for expression evaluators. - Add a Deployment validator that performs an evaluation against a given ExplorationSpecification and which uses expression evaluator base class. - Add a context menu entry to launch the Deployment validation. - Add two Utility methods to handle integer and floating point numbers. refs 2960 --- .../fortiss/tooling/base/utils/BaseMathUtils.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 0612bb5eb..6990b4428 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}. -- GitLab