inria.meije.rc.sugarcubes
Interface JavaStringExpression
- All Superinterfaces:
- JavaExpression, java.io.Serializable
- All Known Implementing Classes:
- JavaStringValue
- public interface JavaStringExpression
- 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 JavaStringExpression interface need to be implemented by the programmer to implement Java computation at run-time of a string.
This kind of atomic expression is usually used by the cube instruction to determine at run-time the name which will be use to reference the cube in the system.
It will also be used by any instruction referring to a Cube, a Shell or a Freezable instruction which is referenced in the system through a name.
- See Also:
SC.cube
,
SC.shell
,
SC.freezable
Method Summary |
java.lang.String |
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 string. |
evaluate
public java.lang.String 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 string.
When computed, the string 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:
- accessing super cubes in the hierarchy of nested Cubes of a reactive program;
- adding new programs in parallel in the reactive machine (real adding is performed at the next instant).
- generation of events (performed at the next instant).
- etc.
- See Also:
Cube