inria.meije.rc.sugarcubes
Interface JavaIdentifierExpression

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

public interface JavaIdentifierExpression
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 JavaIdentifierExpression interface need to be implemented by the programmer to implement Java computation at run-time of an event identifier.
This kind of atomic expression is usually used by the elementary configuration presence (which checks the presence of an event) to compute at run-time the Identifier of the Event it has to check the presence. It gives more flexibility to adapt a program to its execution environment. For example, this is usefull for code migration.
It is also used by the generate instruction to obtain at run-time the identifier of the event it has to generate.
More generally such atomic expression is used by about any SugarCubes instruction having to deal directly with event Identifiers.

See Also:
SC.presence(java.lang.String), SC.generate(java.lang.String)

Method Summary
 Identifier 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 an Event Identifier.
 

Method Detail

evaluate

public Identifier 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 an Event Identifier.
When computed, the event identifier 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