If the condition is true, set the program counter of the state machine.
SMBuilder smb = new SMBuilder(); boolean condition = true; smb._if(condition, "skip"); condition = false; 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!
|
|