|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcdx.scorebot.scoring.logic.VariableInitialization
public class VariableInitialization
specifies a variable to be initialized
Constructor Summary | |
---|---|
VariableInitialization(LiteralType type,
Identifier iden,
Expression exp)
Construct a variable to be initialized |
Method Summary | |
---|---|
void |
executeLogic(Context context)
process this logic code in the specified context |
LiteralType |
getType()
gets the type of variable to initialize |
java.lang.String |
getVarName()
gets the name of this variable |
Expression |
getVarValue()
gets the name and initial value of this variable |
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 VariableInitialization(LiteralType type, Identifier iden, Expression exp)
type
- the type of variable to initializeiden
- name of the variable to initializeexp
- the value to assign idenMethod Detail |
---|
public void executeLogic(Context context) throws LogicException
executeLogic
in interface LogicCodeExecutable
context
- contains the current context of the logic processor
TypeMismatchException
- occurs if the declared variable type is different from the initializer's type
RedefinedVariableException
- occurs if the specified variable's name has already been declared
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 foundpublic LiteralType getType()
public java.lang.String getVarName()
public Expression getVarValue()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |