|
Tea Java Runtime API Version 3.1.0 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.pdmfc.tea.runtime.SContext
Represents a context inside which variables are created and commands executed. Contexts form an hierarchy, where child contexts hide variables defined in parent contexts. A context with no parent is a top level context.
| Constructor Summary | |
protected |
SContext()
Initializes a top level context. |
|
SContext(int initialCapacity)
Initializes a top level context with a particular initial capacity. |
protected |
SContext(SContext parent)
Initializes a context descending from parent. |
| Method Summary | |
protected void |
clearAll()
Forgets all the variables. |
SContext |
clone(SContext parent)
|
java.lang.Object |
getVar(SObjSymbol name)
Obtains the contents of the variable associated with symbol name. |
SObjVar |
getVarObject(SObjSymbol name)
Obtains the contents of the variable associated with symbol name. |
boolean |
isDefined(SObjSymbol name)
Checks if a given variable is defined in this context. |
SContext |
newChild()
|
SObjVar |
newVar(SObjSymbol name,
java.lang.Object value)
Creates a new variable inside this context. |
SObjVar |
newVar(java.lang.String name,
java.lang.Object value)
Creates a new variable inside this context. |
void |
setVar(SObjSymbol name,
java.lang.Object value)
Sets the contents of a variable previously created. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected SContext()
protected SContext(SContext parent)
parent - The parent context of this one. It may be
null.public SContext(int initialCapacity)
| Method Detail |
public SContext newChild()
public SContext clone(SContext parent)
protected void clearAll()
public final SObjVar newVar(java.lang.String name,
java.lang.Object value)
name - The name of the symbol to be associated to the variable being created.value - Reference to the object to be stored inside the variable.public final boolean isDefined(SObjSymbol name)
name - The symbol associated with the variable being checked
for existence.
public final SObjVar newVar(SObjSymbol name,
java.lang.Object value)
name - Symbol to be associated to the variable being created.
public final void setVar(SObjSymbol name,
java.lang.Object value)
throws SNoSuchVarException
name - Symbol associated with the variable to be set.value - Object to store in the variable.SNoSuchVarException - Throw if no variable name was previously created.
public final java.lang.Object getVar(SObjSymbol name)
throws SNoSuchVarException
name - Symbol associated with the variable whose contents are to be retrieved.SNoSuchVarException - Thrown if the variable does not exist neither in this context nor in
any of the contexts up the hierarchy.
public final SObjVar getVarObject(SObjSymbol name)
throws SNoSuchVarException
name - Symbol associated with the variable whose contents are to be retrieved.SNoSuchVarException - Thrown if the variable does not exist neither in this context nor in
any of the contexts up the hierarchy.
|
Tea Java Runtime API Version 3.1.0 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||