|
Tea Java Runtime API Version 3.2.5 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.pdmfc.tea.runtime.SContext
public class 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 toplevel context.
| Constructor Summary | |
|---|---|
protected |
SContext()
Initializes a top level context. |
protected |
SContext(int initialCapacity)
Initializes a top level context with a particular initial capacity. |
|
SContext(SContext parent)
Initializes a context descending from parent. |
| Method Summary | |
|---|---|
protected void |
clearAll()
Forgets all the variables. |
SContext |
clone(SContext parent)
|
SContext |
getParent()
Retrives the parent context. |
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()
Creates a new context having this context for parent. |
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()
public SContext(SContext parent)
parent. Variables defined inside this context hide
variables with the same name inside context. If
parent is null then this will be a
top-level context.
parent - The parent context of this one. It will be
null in the case of a top level context.protected SContext(int initialCapacity)
initialCapacity - The internal hashtable initial capacity.| Method Detail |
|---|
public SContext newChild()
public SContext clone(SContext parent)
public SContext getParent()
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.2.5 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||