|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.iu.cnets.klatsch.lang.Runtime
public class Runtime
This class holds all of the variables for the current runtime environment. It is simply a mapping from
variable names to Value
objects -- the language is dynamically typed, so one mapping works for
everything.
Field Summary | |
---|---|
(package private) java.util.Map<java.lang.String,Value> |
env
|
(package private) Runtime |
parent
|
Constructor Summary | |
---|---|
Runtime()
Initialize a new top-level environment. |
|
Runtime(Runtime parent)
Creates a new environment with the given one as parent. |
Method Summary | |
---|---|
void |
addLibrary()
Extends the environment to include the standard utility functions. |
Runtime |
extend(java.lang.String[] idList,
Value[] valList)
Extends this environment with multiple ID and value bindings. |
Runtime |
extend(java.lang.String id,
Value val)
Extends this environment with a single ID/value binding. |
Value |
get(java.lang.String id)
Returns the value of the given variable. |
(package private) boolean |
isDefined(java.lang.String id)
Checks to see if the given variable is defined in this environment. |
void |
set(java.lang.String id,
Value value)
Sets the value of the given variable as specified. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.util.Map<java.lang.String,Value> env
Runtime parent
Constructor Detail |
---|
public Runtime()
Runtime(Runtime parent)
parent
- the parent environmentMethod Detail |
---|
public void addLibrary()
public Runtime extend(java.lang.String id, Value val)
id
- the IDval
- the valuepublic Runtime extend(java.lang.String[] idList, Value[] valList)
idList
- the set of IDsvalList
- the list of valuespublic Value get(java.lang.String id) throws EvaluationException
id
- the name of the variable
EvaluationException
- if the variable is undefinedboolean isDefined(java.lang.String id)
id
- the name of the variable
public void set(java.lang.String id, Value value)
ELValue
class.
id
- the variable to setvalue
- the value to set it to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |