Package Behavioral.Interpreter
Class Not
java.lang.Object
Behavioral.Interpreter.Not
- All Implemented Interfaces:
Expression
Nonterminal expression representing a logical NOT operation in the interpreter pattern.
Implements the
Expression interface.-
Constructor Summary
ConstructorsConstructorDescriptionNot(Expression expr) Constructs a NOT expression with the specified operand. -
Method Summary
-
Constructor Details
-
Not
Constructs a NOT expression with the specified operand.- Parameters:
expr- the operand expression to negate
-
-
Method Details
-
interpret
Interprets the NOT expression by evaluating its operand and returning the logical negation.- Specified by:
interpretin interfaceExpression- Parameters:
ctx- the context map for variable evaluation- Returns:
- true if the operand evaluates to false; false otherwise
-