Class RealOperations
- java.lang.Object
-
- net.ssehub.easy.varModel.cstEvaluation.RealOperations
-
public class RealOperations extends java.lang.ObjectImplements real operations.- Author:
- Holger Eichelberger, El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static IOperationEvaluatorDIVISION_REAL(package private) static IOperationEvaluatorEQUALS_REAL_INT(package private) static IOperationEvaluatorFLOOR(package private) static IOperationEvaluatorMAX_REAL(package private) static IOperationEvaluatorMIN_REAL(package private) static IOperationEvaluatorMINUS_REAL(package private) static IOperationEvaluatorMODULO_REAL(package private) static IOperationEvaluatorMULTIPLICATION_REAL(package private) static IOperationEvaluatorPLUS_REAL(package private) static IOperationEvaluatorROUND(package private) static IOperationEvaluatorTO_INTImplements the to-integer conversion.(package private) static IOperationEvaluatorUNEQUALS_REAL_INT
-
Constructor Summary
Constructors Modifier Constructor Description privateRealOperations()Prevents external creation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static EvaluationAccessorarithmeticOperationReal(EvaluationAccessor operand, EvaluationAccessor[] arguments, ArithmeticOperationType type)Implements arithmetic operations of two integer variables/values.(package private) static EvaluationAccessorequalsRealInt(EvaluationAccessor operand, EvaluationAccessor[] arguments, boolean negate)Implements the mixed int-real equality operation.private static EvaluationAccessorminmaxOperationReal(EvaluationAccessor operand, EvaluationAccessor[] arguments, boolean min)Implements min/max operations of two integer/real variables/values.static voidregister()Registers the defined operations.private static EvaluationAccessorround(EvaluationAccessor operand, EvaluationAccessor[] arguments, boolean roundUp)Implements arithmetic operations of two integer variables/values.
-
-
-
Field Detail
-
EQUALS_REAL_INT
static final IOperationEvaluator EQUALS_REAL_INT
-
UNEQUALS_REAL_INT
static final IOperationEvaluator UNEQUALS_REAL_INT
-
TO_INT
static final IOperationEvaluator TO_INT
Implements the to-integer conversion.
-
PLUS_REAL
static final IOperationEvaluator PLUS_REAL
-
MINUS_REAL
static final IOperationEvaluator MINUS_REAL
-
MULTIPLICATION_REAL
static final IOperationEvaluator MULTIPLICATION_REAL
-
DIVISION_REAL
static final IOperationEvaluator DIVISION_REAL
-
MODULO_REAL
static final IOperationEvaluator MODULO_REAL
-
FLOOR
static final IOperationEvaluator FLOOR
-
ROUND
static final IOperationEvaluator ROUND
-
MIN_REAL
static final IOperationEvaluator MIN_REAL
-
MAX_REAL
static final IOperationEvaluator MAX_REAL
-
-
Method Detail
-
register
public static final void register()
Registers the defined operations.
-
equalsRealInt
static EvaluationAccessor equalsRealInt(EvaluationAccessor operand, EvaluationAccessor[] arguments, boolean negate)
Implements the mixed int-real equality operation.- Parameters:
operand- the operandarguments- the argumentsnegate- whether the result shall be negated- Returns:
- the comparison result, null if the operation cannot be applied
-
arithmeticOperationReal
private static EvaluationAccessor arithmeticOperationReal(EvaluationAccessor operand, EvaluationAccessor[] arguments, ArithmeticOperationType type)
Implements arithmetic operations of two integer variables/values.- Parameters:
operand- the operandarguments- the argumentstype- The desired arithmetic operation.- Returns:
- The result of the arithmetic operation, null if the operation cannot be applied
-
round
private static EvaluationAccessor round(EvaluationAccessor operand, EvaluationAccessor[] arguments, boolean roundUp)
Implements arithmetic operations of two integer variables/values.- Parameters:
operand- the operandarguments- the argumentsroundUp- If true this operation will round commercial (*.5 and higher will be round up), else numbers will be round down in any case.- Returns:
- The result of the arithmetic operation, null if the operation cannot be applied
-
minmaxOperationReal
private static EvaluationAccessor minmaxOperationReal(EvaluationAccessor operand, EvaluationAccessor[] arguments, boolean min)
Implements min/max operations of two integer/real variables/values.- Parameters:
operand- the operandarguments- the argumentsmin- If true the min operation will be applied, max otherwise.- Returns:
- The min/max of the two parameters, null if the operation cannot be applied
-
-