org.speakright.demos.simpsons
Class App

java.lang.Object
  extended by org.speakright.core.FlowBase
      extended by org.speakright.core.flows.BasicFlow
          extended by org.speakright.core.flows.SRApp
              extended by org.speakright.demos.simpsons.App
All Implemented Interfaces:
java.io.Serializable, IFlow

public class App
extends SRApp

See Also:
Serialized Form

Nested Class Summary
static class App.AskCharacter
           
static class App.CharacterDescription
           
static class App.MainMenu
           
static class App.RelatedCharacterYesNo
           
static class App.VoteYesNo
           
static class App.VotingResultsList
           
 
Field Summary
 Model M
           
 
Fields inherited from class org.speakright.core.flows.BasicFlow
m_L
 
Constructor Summary
App()
           
 
Method Summary
protected  IFlow createWelcome()
          Return the first flow object, which is usually a welcome prompt.
protected  void initMainLoop(LoopFlow loop)
          Return the main loop sub-flow.
 void onBegin(IFlowContext context)
          Invokes getWelcome, getMainLoop, and getGoodbye.
 IFlow onCatch(IFlow current, SRResults results, java.lang.String eventName, ThrowEvent event)
          The default implementation of onCatch is to transfer to the operator.
 
Methods inherited from class org.speakright.core.flows.SRApp
createGoodbye, createMainLoop, getMainLoop, isAppEvent, onDisconnect, onNoInput, onPlatformError, onTransferFailed, onValidateFailed, transferToOperator
 
Methods inherited from class org.speakright.core.flows.BasicFlow
add, addPromptFlow, findSubFlow, getFirst, getNext, getSubFlowAfter, SubFlowCount
 
Methods inherited from class org.speakright.core.FlowBase
createRenderer, execute, executionCount, fixupGrammar, fixupPrompt, log, logError, name, onComplete, onEnd, promptGroup, setExecutionCount, setName, setPromptGroup, shouldExecute, validateInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

M

public Model M
Constructor Detail

App

public App()
Method Detail

createWelcome

protected IFlow createWelcome()
Description copied from class: SRApp
Return the first flow object, which is usually a welcome prompt. Can return an entire sub-flow for welcome + login. This method is optional. The default version returns null. If you don't override this method then you must manually build the flow objects yourself in the constructure.

Overrides:
createWelcome in class SRApp
Returns:

initMainLoop

protected void initMainLoop(LoopFlow loop)
Description copied from class: SRApp
Return the main loop sub-flow. Most apps have an infinite loop that presents a main menu. You can use the loop param passed in, or create one yourself. Populate it with flow objects and return the loop object. This method is optional. The default version returns null. If you don't override this method then you must manually build the flow objects yourself in the constructure.

Overrides:
initMainLoop in class SRApp

onBegin

public void onBegin(IFlowContext context)
Description copied from class: SRApp
Invokes getWelcome, getMainLoop, and getGoodbye. If you override this method you MUST call super.OnBegin

Specified by:
onBegin in interface IFlow
Overrides:
onBegin in class SRApp

onCatch

public IFlow onCatch(IFlow current,
                     SRResults results,
                     java.lang.String eventName,
                     ThrowEvent event)
Description copied from class: SRApp
The default implementation of onCatch is to transfer to the operator.

Specified by:
onCatch in interface IFlow
Overrides:
onCatch in class SRApp
Parameters:
current - the currently executing flow object.
results - the results of current's execution.
eventName - name of the event. most event handling can be done using just the name.
event - event object. advanced event handling may require the actual event object
Returns:
the next flow to run, or null which means this flow object does not handle this event.