cdx.scorebot.scoring.logic
Class TestResultValue

java.lang.Object
  extended by cdx.scorebot.scoring.logic.TestResultValue
All Implemented Interfaces:
LogicCode, LogicCodeEvaluatable, PrimaryExpressionType

public class TestResultValue
extends java.lang.Object
implements LogicCodeEvaluatable, PrimaryExpressionType

holds the value of some test result

Author:
David Underhill

Constructor Summary
TestResultValue(TestIdentifier testIden, Identifier resultIden)
          identifies a specific test result
 
Method Summary
 Literal evaluateLogic(Context context)
          returns the value of the the specified result for the specified test
 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
 Identifier getResultIdentifier()
          get test result identifier
 TestIdentifier getTestIdentifier()
          get test identifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestResultValue

public TestResultValue(TestIdentifier testIden,
                       Identifier resultIden)
identifies a specific test result

Parameters:
testIden - identifier of the test
resultIden - identifier of the result field to get
Method Detail

evaluateLogic

public Literal evaluateLogic(Context context)
                      throws LogicException
returns the value of the the specified result for the specified test

Specified by:
evaluateLogic in interface LogicCodeEvaluatable
Parameters:
context - contains the current context of the logic processor
Returns:
the value of the result
Throws:
LogicException - thrown if an exception occurs while processing the logic

evaluateTypeOnly

public LiteralType evaluateTypeOnly(java.util.HashMap<java.lang.String,LiteralType> varTypes,
                                    java.util.HashMap<java.lang.String,TestData> testsInfo)
                             throws LogicException
Description copied from interface: LogicCodeEvaluatable
returns the kind of literal this evaluates to

Specified by:
evaluateTypeOnly in interface LogicCodeEvaluatable
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
Returns:
the LiteralType this evaluates to
Throws:
LogicException - thrown if there is a problem with type which prevents this from being evaluated

getTestIdentifier

public TestIdentifier getTestIdentifier()
get test identifier


getResultIdentifier

public Identifier getResultIdentifier()
get test result identifier