JMACS

org.jmacs.pd
Interface IProgram

All Superinterfaces:
Serializable

public interface IProgram
extends Serializable

to be implemented by all programs. Synchronization is not required.

Be sure to override Object.toString(), returning a description of what the program does. This will be called once only, prior to init(Context).

Any non-Serializable fields (e.g. driver) should be declared as transient.

Version:
$Id: IProgram.java 2767 2008-02-09 14:41:20Z rob $
Author:
Rob Dickens

Nested Class Summary
static interface IProgram.Context
          context, as passed to init(Context).
static interface IProgram.States
          program states.
 
Method Summary
 void init(IProgram.Context context)
          called once, first, when the program is run.
 void terminate()
          called last, if the program is terminated externally, to permit any tidying up to be performed.
 boolean wake(Alert alert)
          called after init(Context), whenever IProgram.Context.getTimer().sleep() returns.
 

Method Detail

init

void init(IProgram.Context context)
called once, first, when the program is run.


wake

boolean wake(Alert alert)
called after init(Context), whenever IProgram.Context.getTimer().sleep() returns. Time-consuming tasks should not be undertaken.

Parameters:
alert - this will be cleared automatically if not Alert.trigger(String)ed, each time wake is called.
Returns:
false signals program termination

terminate

void terminate()
called last, if the program is terminated externally, to permit any tidying up to be performed.


JMACS

jmacs.org