public final class _SetF extends Object implements _Operation
Assign an (indirect) partial result.
SMBuilder smb = new SMBuilder(); smb._set(new ObjectFunc() { public Object get(StateMachine stateMachine) { System.out.println("Hello world!"); return null; } }); smb._set(new ObjectFunc() { public Object get(StateMachine stateMachine) { return "42"; } }, "r1"); smb._return(new ObjectFunc() { public Object get(StateMachine sm) { return sm.get("r1"); } }); smb.call(rp); Output: Hello world! Result: 42
Constructor and Description |
---|
_SetF(_SMBuilder parentSMB,
ObjectFunc objectFunc,
String resultName)
Create a _SetF
|
public _SetF(_SMBuilder parentSMB, ObjectFunc objectFunc, String resultName)
parentSMB
- The parent builder.objectFunc
- The (indirect) result.resultName
- The name of the result, or null.public void call(SimpleMachine stateMachine, RP rp) throws Exception
call
in interface _Operation
stateMachine
- The state machine driving the operation.rp
- The response processor.Exception
- Any uncaught exceptions raised while performing the operation.Copyright © 2012. All Rights Reserved.