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