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.


Variable Index

 o exception
 o result
The computed value or the exception.

Constructor Index

 o Evaluation(WorldAble, DynamicEnvironment, Value)
Prepare for the evaluation of an expression E in the global environment WORLD and dynamic environment DENV.

Method Index

 o getDynamicEnvironment()
 o getStatus()
 o getStatusName()
 o getWorld()
 o obtain()
Synchronous evaluation within a World.
 o run()
Perform an Evaluation.
 o setDynamicEnvironment(DynamicEnvironment)
 o setStatus(int)

Variables

 o result
 protected Value result
The computed value or the exception. The status fixes the ambiguity which one may be safely read.

 o exception
 protected Exception exception

Constructors

 o 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.

Methods

 o getWorld
 public WorldAble getWorld()
 o getDynamicEnvironment
 public synchronized DynamicEnvironment getDynamicEnvironment()
 o setDynamicEnvironment
 public synchronized void setDynamicEnvironment(DynamicEnvironment denv)
 o getStatus
 public synchronized int getStatus()
 o setStatus
 protected synchronized void setStatus(int status)
 o getStatusName
 public String getStatusName()
 o 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.
 o 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