|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cdx.scorebot.scoring.logic.Assignment
public class Assignment
evaluates an assignment statement
Constructor Summary | |
---|---|
Assignment(Identifier varIden,
OperatorType assignmentOperator,
Expression value)
instantiate an assignment statement |
Method Summary | |
---|---|
Literal |
evaluateLogic(Context context)
evaluate this logic code 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 |
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 Assignment(Identifier varIden, OperatorType assignmentOperator, Expression value)
varIden
- identifier of the variable to assign toassignmentOperator
- assignment operator to usevalue
- the value to assignMethod Detail |
---|
public Literal evaluateLogic(Context context) throws LogicException
evaluateLogic
in interface LogicCodeEvaluatable
context
- contains the current context of the logic processor
LogicException
- thrown if an exception occurs while processing the logicpublic void executeLogic(Context context) throws LogicException
executeLogic
in interface LogicCodeExecutable
context
- contains the current context of the logic processor
LogicException
- thrown if an exception occurs while processing the logicpublic LiteralType evaluateTypeOnly(java.util.HashMap<java.lang.String,LiteralType> varTypes, java.util.HashMap<java.lang.String,TestData> testsInfo) throws LogicException
LogicCodeEvaluatable
evaluateTypeOnly
in interface LogicCodeEvaluatable
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 there is a problem with type which prevents this from being evaluatedpublic 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 |