Package Behavioral.Interpreter
Class Or
java.lang.Object
Behavioral.Interpreter.Or
- All Implemented Interfaces:
Expression
Nonterminal expression representing a logical OR operation in the interpreter pattern.
Implements the
Expression interface.-
Constructor Summary
ConstructorsConstructorDescriptionOr(Expression left, Expression right) Constructs an OR expression with the specified left and right operands. -
Method Summary
-
Constructor Details
-
Or
Constructs an OR expression with the specified left and right operands.- Parameters:
left- the left operand expressionright- the right operand expression
-
-
Method Details
-
interpret
Interprets the OR expression by evaluating both operands and returning their logical disjunction.- Specified by:
interpretin interfaceExpression- Parameters:
ctx- the context map for variable evaluation- Returns:
- true if at least one operand evaluates to true; false otherwise
-