Class GenericNumberOperations
java.lang.Object
net.ssehub.easy.varModel.cstEvaluation.GenericNumberOperations
Generic Number (
IntegerType, RealType) operations.- Author:
- El-Sharkawy
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceStrategy for comparing two numbers. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final IOperationEvaluatorprivate static final IOperationEvaluatorprivate static final GenericNumberOperations.INumberComparatorprivate static final IOperationEvaluatorprivate static final GenericNumberOperations.INumberComparatorprivate static final IOperationEvaluatorprivate static final IOperationEvaluatorprivate static final GenericNumberOperations.INumberComparatorprivate static final IOperationEvaluatorprivate static final GenericNumberOperations.INumberComparator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static EvaluationAccessorabsolute(EvaluationAccessor operand, EvaluationAccessor[] arguments) Removes the sign of a number (IntegerTypeorRealType).private static EvaluationAccessorcomparisionOperation(EvaluationAccessor operand, EvaluationAccessor[] arguments, GenericNumberOperations.INumberComparator strategy) Compares two numbers.private static EvaluationAccessorinverse(EvaluationAccessor operand, EvaluationAccessor[] arguments) Negates a number (IntegerTypeorRealType).static final voidregister()Registers the defined operations.
-
Field Details
-
LESS_COMPARATOR
-
LESS_EQUALS_COMPARATOR
-
GREATER_COMPARATOR
-
GREATER_EQUALS_COMPARATOR
-
GREATER
-
GREATER_EQUALS
-
LESS
-
LESS_EQUALS
-
INVERSE
-
ABSOLUTE
-
-
Constructor Details
-
GenericNumberOperations
GenericNumberOperations()
-
-
Method Details
-
register
public static final void register()Registers the defined operations. -
comparisionOperation
private static EvaluationAccessor comparisionOperation(EvaluationAccessor operand, EvaluationAccessor[] arguments, GenericNumberOperations.INumberComparator strategy) Compares two numbers. Supported comparisons are: less, less_equals, greater, and greater_equals.- Parameters:
operand- the operandarguments- the argumentsstrategy- AGenericNumberOperations.INumberComparator, specifying which comparison should be used.- Returns:
- The result of the comparison.
-
inverse
private static EvaluationAccessor inverse(EvaluationAccessor operand, EvaluationAccessor[] arguments) Negates a number (IntegerTypeorRealType).- Parameters:
operand- The number which shall be negated.arguments- Must be null or empty.- Returns:
- The given operand * -1;
-
absolute
private static EvaluationAccessor absolute(EvaluationAccessor operand, EvaluationAccessor[] arguments) Removes the sign of a number (IntegerTypeorRealType).- Parameters:
operand- The number which shall be made absolute.arguments- Must be null or empty.- Returns:
- The given |operand|;
-