|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcdx.scorebot.scoring.logic.Literal
public class Literal
holds a literal value
Constructor Summary | |
---|---|
Literal(java.lang.Object value)
instantiate a Literal value |
Method Summary | |
---|---|
java.lang.Boolean |
boolValue()
gets the value if it is a boolean and returns null otherwise |
java.lang.Double |
doubleValue()
gets the value if it is a double (or integer) and returns null otherwise |
Literal |
evaluateLogic(Context context)
a literal is an atomic value, so this just returns itself |
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 |
LiteralType |
getType()
gets the type of this literal |
java.lang.Object |
getValue()
gets the value of this literal |
java.lang.Integer |
intValue()
gets the value if it is a integer and returns null otherwise |
boolean |
isBoolean()
whether or not the literal is a Boolean |
boolean |
isDouble()
whether or not the literal is a Boolean |
boolean |
isInteger()
whether or not the literal is a Boolean |
boolean |
isString()
whether or not the literal is a Boolean |
java.lang.String |
stringValue()
gets the value if it is a string and returns null otherwise |
java.lang.String |
toString()
gets the string representation of the value stored by this literal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Literal(java.lang.Object value) throws TypeMismatchException
value
- the value of this literal
TypeMismatchException
Method 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 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 java.lang.Object getValue()
public LiteralType getType()
public boolean isBoolean()
public boolean isDouble()
public boolean isInteger()
public boolean isString()
public java.lang.Boolean boolValue()
public java.lang.Double doubleValue()
public java.lang.Integer intValue()
public java.lang.String stringValue()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |