inria.meije.rc.sugarcubes
Interface JavaProgramExpression

All Superinterfaces:
JavaExpression, java.io.Serializable
All Known Implementing Classes:
JavaProgramValue

public interface JavaProgramExpression
extends JavaExpression

While executing, SugarCubes programs often needs to operate some modifications to the state of some Java objects on which it is intend to operate. Those data processing operations in SugarCubes are handled by atomic operations.
Some of those atomic operations are performed to compute values at run-time, which are needed to parameterize the execution of some reactive instructions. For example, one wants to get an integer value at run-time to know how many iterations a repeat instruction has to do. Those atomic operations returning a value used in a reactive program are called atomic expressions.

The JavaProgramExpression interface needs to be implemented by the programmer to implement Java computation at run-time of the reference of reactive program, which can be constructed dynamically at that moment.
This kind of atomic expression is usually used by the addToShell instruction to determine at run-time the reactive program to add dynamically to a cube object.

See Also:
SC.add, SC.cube

Method Summary
 Program evaluate(java.lang.Object self, LocalVariables vars, ReactiveEngine engine)
          This method needs to be implemented by the SugarCubes programmer to perform run-time atomic computation of a reactive program.
 

Method Detail

evaluate

public Program evaluate(java.lang.Object self,
                        LocalVariables vars,
                        ReactiveEngine engine)
This method needs to be implemented by the SugarCubes programmer to perform run-time atomic computation of a reactive program.
When computed, the reactive program is returned by the evaluate method.
The first argument passed to this method when the atomic expression need to be executed by the reactive program is the java object to which the reactive program is bound. This is probably the most important argument which allows one to get a first reference to an object in the Java environment of a reactive program.
The second argument is a reference to the linked list of local variables defined in the reactive program.
The last argument is a reference to the reactive execution environment allowing special manipulations such as:
See Also:
Cube