|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcdx.scorebot.scoring.logic.ExpressionLeftAssociative<SUBEXP>
public abstract class ExpressionLeftAssociative<SUBEXP extends LogicCodeEvaluatable>
Defines a left-associate expression (A || B || C is equivalent to ((A || B) || C).
| Field Summary | |
|---|---|
protected SUBEXP |
leftOperand
left operand |
protected java.util.Vector<SUBEXP> |
rightOperands
right operand(s) |
| Constructor Summary | |
|---|---|
ExpressionLeftAssociative(SUBEXP leftOperand)
instantiate the expression |
|
| Method Summary | |
|---|---|
protected void |
addOperand(OperatorType op,
SUBEXP operand)
adds an operator and operand to this expression |
Literal |
evaluateLogic(Context context)
evaluate this expression in the specified context |
LiteralType |
evaluateTypeOnly(java.util.HashMap<java.lang.String,LiteralType> varTypes,
java.util.HashMap<java.lang.String,TestData> testsInfo)
returns the kind of literal this evaluates to |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected SUBEXP extends LogicCodeEvaluatable leftOperand
protected java.util.Vector<SUBEXP extends LogicCodeEvaluatable> rightOperands
| Constructor Detail |
|---|
public ExpressionLeftAssociative(SUBEXP leftOperand)
leftOperand - left operand| Method Detail |
|---|
public Literal evaluateLogic(Context context)
throws LogicException
evaluateLogic in interface LogicCodeEvaluatablecontext - contains the current context of the logic processor
TypeMismatchException - thrown if an operand isn't of the required type
LogicException - thrown if an exception occurs while processing the logic
public LiteralType evaluateTypeOnly(java.util.HashMap<java.lang.String,LiteralType> varTypes,
java.util.HashMap<java.lang.String,TestData> testsInfo)
throws LogicException
LogicCodeEvaluatable
evaluateTypeOnly in interface LogicCodeEvaluatablevarTypes - contains the type of value stored by each variable (variables names are keys)testsInfo - information about each test item keyed on test item names this logic may hold
LogicException - thrown if there is a problem with type which prevents this from being evaluated
protected void addOperand(OperatorType op,
SUBEXP operand)
op - the operator to use to add this operand to the expressionoperand - the operand to add to the expression
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||