All Packages Class Hierarchy This Package Previous Next Index
Class Jaja.Evaluation
java.lang.Object
|
+----java.lang.Thread
|
+----Jaja.Evaluation
- public class Evaluation
- extends Thread
- implements EvaluationAble
This class implements the evaluation mechanism. The evaluation is
represented by a thread. An Evaluation is a single-shot entity
that can only be used one time since it is no longer alive after
the death of the thread). This is a design choice (a hack?) since
some data are may be needed everywhere in the computation and it
would be dangerous to use global variables for this
information. Since it is everywhere possible to get the current
Thread and to subclass Thread to offer additional data, I used this
technique to provide a dynamic environment that will hold the
values of ubiquitous data such as the current input port, the URL
of the applet etc.
-
exception
-
-
result
- The computed value or the exception.
-
Evaluation(WorldAble, DynamicEnvironment, Value)
- Prepare for the evaluation of an expression E in the global
environment WORLD and dynamic environment DENV.
-
getDynamicEnvironment()
-
-
getStatus()
-
-
getStatusName()
-
-
getWorld()
-
-
obtain()
- Synchronous evaluation within a World.
-
run()
- Perform an Evaluation.
-
setDynamicEnvironment(DynamicEnvironment)
-
-
setStatus(int)
-
result
protected Value result
- The computed value or the exception. The status fixes the
ambiguity which one may be safely read.
exception
protected Exception exception
Evaluation
public Evaluation(WorldAble w,
DynamicEnvironment denv,
Value e)
- Prepare for the evaluation of an expression E in the global
environment WORLD and dynamic environment DENV. The evaluation is
not immediately started.
getWorld
public WorldAble getWorld()
getDynamicEnvironment
public synchronized DynamicEnvironment getDynamicEnvironment()
setDynamicEnvironment
public synchronized void setDynamicEnvironment(DynamicEnvironment denv)
getStatus
public synchronized int getStatus()
setStatus
protected synchronized void setStatus(int status)
getStatusName
public String getStatusName()
obtain
public Value obtain() throws Exception
- Synchronous evaluation within a World. Returns the final value
or throws the obtained exception.
- Throws: Exception
- errors when running Jaja belong to RuntimeException,
Other errors may occur due to remote method invokation.
run
public void run()
- Perform an Evaluation. The expression is macroexpanded before
being evaluated. This method is overriden in the Invokation
class. @see Invokation
- Overrides:
- run in class Thread
All Packages Class Hierarchy This Package Previous Next Index