Package org.protelis.vm
Interface ExecutionEnvironment
-
- All Known Implementing Classes:
SimpleExecutionEnvironment
public interface ExecutionEnvironmentTheExecutionEnvironmentis responsible of managing environment variables.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcommit()Called just after the VM is executed, to finalize information of the execution for the environment.java.lang.Objectget(java.lang.String id)java.lang.Objectget(java.lang.String id, java.lang.Object defaultValue)booleanhas(java.lang.String id)java.util.Set<java.lang.String>keySet()booleanput(java.lang.String id, java.lang.Object v)java.lang.Objectremove(java.lang.String id)voidsetup()Called just before the VM is executed, to enable and preparations needed in the environment.
-
-
-
Method Detail
-
has
boolean has(java.lang.String id)
- Parameters:
id- the variable name- Returns:
- true if the variable is present
-
get
java.lang.Object get(java.lang.String id)
- Parameters:
id- the variable name- Returns:
- the value of the variable if present, false otherwise
-
get
java.lang.Object get(java.lang.String id, java.lang.Object defaultValue)- Parameters:
id- the variable namedefaultValue- a parameterizable default value- Returns:
- the value of the variable if present, defaultValue otherwise
-
put
boolean put(java.lang.String id, java.lang.Object v)- Parameters:
id- the variable namev- the value that should be associated with id- Returns:
- true if there was previously a value associated with id, and false if not.
-
remove
java.lang.Object remove(java.lang.String id)
- Parameters:
id- the variable name- Returns:
- Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.
-
keySet
java.util.Set<java.lang.String> keySet()
- Returns:
- An unmodifiable set of the keys in the ExecutionEnvironment
-
commit
void commit()
Called just after the VM is executed, to finalize information of the execution for the environment.
-
setup
void setup()
Called just before the VM is executed, to enable and preparations needed in the environment.
-
-