cdx.scorebot.scoring.logic
Class Statement

java.lang.Object
  extended by cdx.scorebot.scoring.logic.Statement
All Implemented Interfaces:
BlockStatementType, LogicCode, LogicCodeExecutable

public class Statement
extends java.lang.Object
implements LogicCodeExecutable, BlockStatementType

specifies a statement to be evaluated

Author:
David Underhill

Constructor Summary
Statement(StatementType statement)
          Construct a statement to be executed
 
Method Summary
 void executeLogic(Context context)
          execute this statement
 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

Statement

public Statement(StatementType statement)
Construct a statement to be executed

Parameters:
statement - statement to execute
Method Detail

executeLogic

public void executeLogic(Context context)
                  throws LogicException
execute this statement

Specified by:
executeLogic in interface LogicCodeExecutable
Parameters:
context - contains the current context of the logic processor
Throws:
LogicException - thrown if an exception occurs while processing the logic

validateTypes

public void validateTypes(java.util.HashMap<java.lang.String,LiteralType> varTypes,
                          java.util.HashMap<java.lang.String,TestData> testsInfo)
                   throws LogicException
Description copied from interface: LogicCodeExecutable
Attempts to validate the type-correctness of all constituent LogicCodeEvaluatable logic code. An exception is thrown if there is some type-check failure.

Specified by:
validateTypes in interface LogicCodeExecutable
Parameters:
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
Throws:
LogicException - thrown if an exception if an invalid test, test result, or test option is found