|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcdx.scorebot.scoring.logic.IfStatement
public class IfStatement
evaluates an if statement
Constructor Summary | |
---|---|
IfStatement(ConditionalOrExpression condition,
Statement ifBody)
instantiate an if statement |
|
IfStatement(ConditionalOrExpression condition,
Statement ifBody,
Statement elseBody)
instantiate an if-else statement |
Method Summary | |
---|---|
void |
executeLogic(Context context)
process this logic code in the specified context |
void |
validateTypes(java.util.HashMap<java.lang.String,LiteralType> varTypes,
java.util.HashMap<java.lang.String,TestData> testsInfo)
Attempts to validate the type-correctness of all constituent LogicCodeEvaluatable logic code. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IfStatement(ConditionalOrExpression condition, Statement ifBody)
condition
- the conditionifBody
- the statement to execute if the condition is truepublic IfStatement(ConditionalOrExpression condition, Statement ifBody, Statement elseBody)
condition
- the conditionifBody
- the statement to execute if the condition is trueelseBody
- the statement to execute if the condition is falseMethod Detail |
---|
public void executeLogic(Context context) throws LogicException
executeLogic
in interface LogicCodeExecutable
context
- contains the current context of the logic processor
TypeMismatchException
- thrown if the condition does not evaluate to a literal boolean value
LogicException
- thrown if an exception occurs while processing the logicpublic void validateTypes(java.util.HashMap<java.lang.String,LiteralType> varTypes, java.util.HashMap<java.lang.String,TestData> testsInfo) throws LogicException
LogicCodeExecutable
validateTypes
in interface LogicCodeExecutable
varTypes
- 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 an exception if an invalid test, test result, or test option is found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |