org.speakright.sro
Class SROConfirmYesNo

java.lang.Object
  extended by org.speakright.core.FlowBase
      extended by org.speakright.core.flows.QuestionFlow
          extended by org.speakright.sro.BaseSROQuestion
              extended by org.speakright.sro.gen.genSROConfirmYesNo
                  extended by org.speakright.sro.SROConfirmYesNo
All Implemented Interfaces:
java.io.Serializable, IConfirmationFlow, IFlow

public class SROConfirmYesNo
extends genSROConfirmYesNo
implements IConfirmationFlow

SRO for doing simple yes/no confirmation. This confirmer can be used with any SRO by passing an instance of SROConfirmYesNo to the SRO's setConfirmer method. This confirmer does explicit confirmation, accepting yes or no as the answer. eg. "Do you want Boston?" If the user answers no then a confirm-rejection occurs and the SRO asks its question again. Features

Author:
IanRaeLaptop
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.speakright.sro.BaseSROQuestion
BaseSROQuestion.MyConfirmationWrapper
 
Field Summary
 
Fields inherited from class org.speakright.sro.gen.genSROConfirmYesNo
m_confirmGrammar
 
Fields inherited from class org.speakright.sro.BaseSROQuestion
m_cmds, m_main1Prompt, m_maxReExecutions, m_modelVar, m_noreco1Prompt, m_noreco2Prompt, m_noreco3Prompt, m_noreco4Prompt, m_prefixPrompt, m_silence1Prompt, m_silence2Prompt, m_silence3Prompt, m_silence4Prompt, m_slotName, m_subject, m_subjectWord
 
Fields inherited from class org.speakright.core.flows.QuestionFlow
m_quest
 
Constructor Summary
SROConfirmYesNo(java.lang.String subject)
           
 
Method Summary
 int confirmThreshold()
           
 IFlow getNext(IFlow current, SRResults results)
          The default implementation of getNext is to return null.
 boolean needToExecute(IFlow current, SRResults results)
          Inspect the results to see if confirmation is needed.
 void setConfirmThreshold(int threshold)
           
 void setNotifier(IConfirmationNotifier notifier)
          Set the notifier, which MUST be called from within the confirmation flow's getNext.
 
Methods inherited from class org.speakright.sro.gen.genSROConfirmYesNo
execute, initSubPrompts, set_confirmGrammar
 
Methods inherited from class org.speakright.sro.BaseSROQuestion
addCancelCommand, addCommand, initMainPrompt, initPrompt, initPrompts, initPrompts, onValidateFailed, set_main1Prompt, set_noreco1Prompt, set_noreco2Prompt, set_noreco3Prompt, set_noreco4Prompt, set_prefixPrompt, set_silence1Prompt, set_silence2Prompt, set_silence3Prompt, set_silence4Prompt, setConfirmer, setModelVar, setPromptCondition, setSubjectPlurality
 
Methods inherited from class org.speakright.core.flows.QuestionFlow
add, addBinding, addGrammar, addGrammar, addPrompt, createRenderer, InitPrompts
 
Methods inherited from class org.speakright.core.FlowBase
executionCount, fixupGrammar, fixupPrompt, getFirst, getSubFlowAfter, log, logError, name, onBegin, onCatch, onComplete, onDisconnect, onEnd, onNoInput, onPlatformError, onTransferFailed, promptGroup, setExecutionCount, setName, setPromptGroup, shouldExecute, validateInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.speakright.core.IFlow
createRenderer, execute, executionCount, fixupGrammar, fixupPrompt, getFirst, getSubFlowAfter, name, onBegin, onCatch, onComplete, onDisconnect, onEnd, onNoInput, onPlatformError, onTransferFailed, onValidateFailed, promptGroup, setExecutionCount, setPromptGroup, shouldExecute, validateInput
 

Constructor Detail

SROConfirmYesNo

public SROConfirmYesNo(java.lang.String subject)
Method Detail

confirmThreshold

public int confirmThreshold()

setConfirmThreshold

public void setConfirmThreshold(int threshold)

setNotifier

public void setNotifier(IConfirmationNotifier notifier)
Description copied from interface: IConfirmationFlow
Set the notifier, which MUST be called from within the confirmation flow's getNext. Used to notify the confirmation wrapper. MUST call this from getNext when the confirmation finishes.

Specified by:
setNotifier in interface IConfirmationFlow
Parameters:
notifier - the confirmation wrapper

needToExecute

public boolean needToExecute(IFlow current,
                             SRResults results)
Description copied from interface: IConfirmationFlow
Inspect the results to see if confirmation is needed. Some confirmers may only kick if in the confidence level of the previous answer was less than some threshold.

Specified by:
needToExecute in interface IConfirmationFlow
Parameters:
current - the current flow objects
results - results from the question for which we may do confirmation.
Returns:
true if confirmation should be done.

getNext

public IFlow getNext(IFlow current,
                     SRResults results)
Description copied from class: FlowBase
The default implementation of getNext is to return null.

Specified by:
getNext in interface IFlow
Overrides:
getNext in class BaseSROQuestion
Parameters:
current - the currently executing flow object. More precisely, current is the flow object that this object most recently returned from getFirst or getNext.
results - the results of current's execution by the speech platform. Results contains user input and/or events such as disconnect or platform-error.
Returns:
the next flow to run, or null which means this flow object is finished.