|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcdx.scorebot.scoring.logic.GenericMethod
cdx.scorebot.scoring.logic.Method
public class Method
evaluates a method call which returns a value (this is called a "function")
| Constructor Summary | |
|---|---|
Method(Identifier methodName,
Arguments args)
Instantiate a method call which returns a value. |
|
| Method Summary | |
|---|---|
Literal |
evaluateLogic(Context context)
evaluate the method called 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 |
static LiteralType[] |
getArgTypes(java.lang.String methodName)
gets an array with the names of methods which return some value |
static java.lang.String[] |
getMethods()
gets an array with the names of methods which return some value |
static java.lang.String |
getSignature(java.lang.String name)
|
| Methods inherited from class cdx.scorebot.scoring.logic.GenericMethod |
|---|
getArgs, getMethodName, throwIAE |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Method(Identifier methodName,
Arguments args)
methodName - the name of the methodargs - the arguments to the method callContext.compareDates(java.lang.String, cdx.scorebot.scoring.logic.OperatorType, java.lang.String),
Context.count(java.lang.String, int, java.lang.String, cdx.scorebot.scoring.logic.OperatorType, cdx.scorebot.scoring.logic.Literal),
Context.tostring(cdx.scorebot.scoring.logic.Literal)| Method Detail |
|---|
public Literal evaluateLogic(Context context)
throws LogicException
evaluateLogic in interface LogicCodeEvaluatablecontext - contains the current context of the logic processor
UndefinedMethodException - thrown if the specified method name does not reference a method which exists
IllegalMethodArgsException - thrown if the specified method name exists but the args don't meet expectations
LogicException - thrown if an exception occurs while processing the logic
public LiteralType evaluateTypeOnly(java.util.HashMap<java.lang.String,LiteralType> varTypes,
java.util.HashMap<java.lang.String,TestData> testsInfo)
throws LogicException
LogicCodeEvaluatable
evaluateTypeOnly in interface LogicCodeEvaluatablevarTypes - 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 static java.lang.String[] getMethods()
public static LiteralType[] getArgTypes(java.lang.String methodName)
throws UndefinedMethodException
UndefinedMethodException
public static java.lang.String getSignature(java.lang.String name)
throws IllegalMethodArgsException,
UndefinedMethodException
IllegalMethodArgsException
UndefinedMethodException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||