public class _Goto extends Object implements _Operation
Set the program counter of the state machine.
SMBuilder smb = new SMBuilder();
smb._goto("skip");
smb._set(new ObjectFunc() {
public Object get(StateMachine sm) {
System.out.println("does not print");
return null;
}
});
smb._label("skip");
smb._set(new ObjectFunc() {
public Object get(StateMachine stateMachine) {
System.out.println("Hello world!");
return null;
}
});
smb.call(rp);
Output:
Hello world!
| Constructor and Description |
|---|
_Goto(_SMBuilder parentSMB,
String label)
Create a _Goto.
|
public _Goto(_SMBuilder parentSMB, String label)
parentSMB - The parent builder.label - The identifier of where to go to.public void call(SimpleMachine stateMachine, RP rp) throws Exception
call in interface _OperationstateMachine - The state machine driving the operation.rp - The response processor.Exception - Any uncaught exceptions raised while performing the operation.Copyright © 2012. All Rights Reserved.