stella.xml
Class LoopingSequencer.Conditioner
java.lang.Object
java.lang.Thread
stella.xml.LoopingSequencer.Conditioner
- All Implemented Interfaces:
- Runnable, AlarmHandler
- Enclosing class:
- LoopingSequencer
private class LoopingSequencer.Conditioner
- extends Thread
- implements AlarmHandler
The helper class that deals with incoming reply messages. First, the
sequencer is called to convert the incoming reply to a valid variable
name. Then, the conditioner roams through its list of variables and
- Sets variable with identical names to true.
- If a delay is encountered matching the variable under question, an
Alarm thread is started with the entire variable's name as
an argument, i.e. with the attached delay tag.
This method synchronizes on the variable map. It starts itself after
construction.
|
Method Summary |
void |
run()
The run method of the conditioner. |
void |
setOff(String varname)
This method is called if a delayed condition is met. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
reply
private ReplyEvent reply
- The reply received.
LoopingSequencer.Conditioner
private LoopingSequencer.Conditioner(ReplyEvent rep)
- Constructs and starts a new conditioner processing the argument
reply event.
setOff
public void setOff(String varname)
- This method is called if a delayed condition is met. I.e. booleans
like DONE_MOVE+1000 are treated here. Whenever the
DONE_MOVE reply is registered in the
LoopingSequencer.forward(stella.ReplyEvent)
receiving
end an Alarm is spawned with the specified delay time (ms).
If the alarm ran out the alarm threads name is used to set the
matching boolean variable to true.
- Specified by:
setOff in interface AlarmHandler
- Parameters:
The - name of the alarm thread equal the variable name
run
public void run()
- The run method of the conditioner. It synchronizes on the
variable map. Entries in this map matching the variable
name constructed from the original reply are treated in the
following way:
- Sets variable with identical names to true.
- If a delay is encountered matching the variable under question,
an Alarm thread is started with the entire variable's name as
an argument, i.e. with the attached delay tag.
- Specified by:
run in interface Runnable- Overrides:
run in class Thread