?? andexp.java
字號:
/**
* A NonterminalExpression
*/
public class AndExp implements BooleanExp {
private BooleanExp operand1;
private BooleanExp operand2;
public AndExp(BooleanExp oper1, BooleanExp oper2) {
operand1 = oper1;
operand2 = oper2;
}
public boolean Evaluate(Context c) {
return operand1.Evaluate(c) &&
operand2.Evaluate(c);
}
public BooleanExp Copy() {
return new AndExp(operand1.Copy(), operand2.Copy());
}
public BooleanExp Replace(String var, BooleanExp exp) {
return new AndExp(
operand1.Replace(var, exp),
operand2.Replace(var, exp)
);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -