|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.utils.program.Value
This class represents a value to be resolved during program execution
| Field Summary | |
static long |
MILLISECONDS_IN_A_DAY
|
static boolean |
NOT_A_BOOLEAN
|
static java.util.Date |
NOT_A_DATE
|
static java.lang.String |
NOT_A_STRING
|
static int |
NOT_AN_INT
|
| Constructor Summary | |
Value(java.lang.String name,
int type)
constructor for variables |
|
Value(Token t,
Lexer l)
Constructor which performs a symbol table lookup if the symbol is not found, assume it is a word. |
|
Value(Value v)
Constructor which copies a Value |
|
| Method Summary | |
java.lang.Object |
clone()
Clones a tree (or sub-tree) and returns the root of the new tree. |
boolean |
evaluate(java.util.HashMap localVars)
evaluates an expression tree and returns true or false from the top |
Value[] |
getArgs()
Returns the args |
int |
getArity()
Returns the arity of this node. |
boolean |
getBool()
Returns the boolean |
boolean |
getBooleanValue(java.util.HashMap localVars)
Returns the boolean value of this node. |
java.util.Date |
getDate()
Returns the date |
java.util.Date |
getDateValue(java.util.HashMap localVars)
Returns the date value of this node. |
int |
getIntValue(java.util.HashMap localVars)
Returns the int value of this node. |
Value |
getLeft()
Get the left child of this node. |
java.lang.String |
getName()
Returns the string for the human readable name of the symbol. |
int |
getNum()
Returns the int |
int |
getParenLevel()
Returns the depth that this node is nested within parens. |
Value |
getParent()
Get the parent of this node. |
int |
getPrecedence()
Returns the precedence of this node. |
Value |
getRight()
Get the right child of this node. |
java.lang.String |
getString()
Returns the String |
java.lang.String |
getStringValue(java.util.HashMap localVars)
Returns the string value of this node. |
int |
getType()
Returns the type of this node. |
Value |
insertValue(Value newValue,
Value current)
Inserts a node starting at current level, then bubbles up to the proper precedence level. |
boolean |
isBoolean()
Checks whether this is a boolean returning value. |
boolean |
isDate()
Checks whether this is a date returning value. |
boolean |
isInt()
Checks whether this is a integer returning value. |
boolean |
isString()
Checks whether this is a string returning value. |
java.lang.String |
probeParentField()
Scans the tree from this point to find a "parent" field. |
void |
setArgs(Value[] a)
Returns the args |
void |
setArity(int a)
Set the arity of this node. |
void |
setBooleanValue(boolean b)
Set the boolean value of this node. |
void |
setDateValue(java.util.Date d)
Set the date value of this node. |
void |
setIntValue(int n)
Set the int value of this node. |
void |
setLeft(Value n)
Set the left child of this node. |
void |
setName(java.lang.String n)
Sets the name string. |
void |
setParenLevel(int l)
Sets the level or parenthesis depth . |
void |
setParent(Value n)
Set the parent of this node. |
void |
setPrecedence(int p)
Sets the precedence of this node. |
void |
setRight(Value n)
Set the right child of this node. |
void |
setStringValue(java.lang.String s)
Set the string value of this node. |
void |
setType(int t)
Set the type of this node. |
java.lang.String |
toTreeString()
|
java.lang.String |
toTreeString(int level)
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final long MILLISECONDS_IN_A_DAY
public static final int NOT_AN_INT
public static final java.lang.String NOT_A_STRING
public static final java.util.Date NOT_A_DATE
public static final boolean NOT_A_BOOLEAN
| Constructor Detail |
public Value(Token t,
Lexer l)
l - the instance of the lexer.public Value(Value v)
public Value(java.lang.String name,
int type)
| Method Detail |
public java.lang.String getName()
public void setName(java.lang.String n)
public int getType()
public void setType(int t)
public int getParenLevel()
public void setParenLevel(int l)
public int getPrecedence()
public void setPrecedence(int p)
public Value getParent()
public void setParent(Value n)
public Value getLeft()
public void setLeft(Value n)
public Value getRight()
public void setRight(Value n)
public boolean isInt()
public boolean isString()
public boolean isBoolean()
public boolean isDate()
public boolean getBooleanValue(java.util.HashMap localVars)
public void setBooleanValue(boolean b)
public int getIntValue(java.util.HashMap localVars)
public void setIntValue(int n)
public java.util.Date getDateValue(java.util.HashMap localVars)
public void setDateValue(java.util.Date d)
public java.lang.String getStringValue(java.util.HashMap localVars)
public void setStringValue(java.lang.String s)
public java.lang.String getString()
public int getNum()
public java.util.Date getDate()
public boolean getBool()
public void setArgs(Value[] a)
public Value[] getArgs()
public int getArity()
public void setArity(int a)
public Value insertValue(Value newValue,
Value current)
public java.lang.String probeParentField()
public java.lang.Object clone()
public boolean evaluate(java.util.HashMap localVars)
public java.lang.String toTreeString()
public java.lang.String toTreeString(int level)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||