Fido Alpha 3.2

fido.response
Class Response

java.lang.Object
  |
  +--fido.response.Response

public class Response
extends java.lang.Object

Collects information during processing to report back to the user. Methods of this class are called by the Processing module to set the status of executed commands, or report an error.

Todo:


Constructor Summary
Response()
          Creates a new Response instance.
 
Method Summary
 void addReturnObject(int id)
          Adds the object the user requested.
 void addWhichObject(int id)
          Adds an object to the list of possible object the user ment.
 java.lang.String generateResponse()
          After all processing is complete, this method generates a natural language response.
 boolean getProcessingStatus()
          Returns the status of the last command run by the system.
 void reset()
          Returns the class to its default state.
 void setMissingInformation(int id)
           
 void setProcessingStatus(boolean status)
          If the user requests the system perform an action, the system will report if the action was successful or not.
 void setYesNoResponse(boolean response)
          If the user queries the system, the system will call this method, from an internal instruction, to set the yes / no response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Response

public Response()
Creates a new Response instance.

Method Detail

reset

public void reset()
Returns the class to its default state. This should be called before processing each command.


setYesNoResponse

public void setYesNoResponse(boolean response)
If the user queries the system, the system will call this method, from an internal instruction, to set the yes / no response.


setProcessingStatus

public void setProcessingStatus(boolean status)
If the user requests the system perform an action, the system will report if the action was successful or not. The response parameter is set by the processing module if the simple action was successful.

Ex. Throw the ball. If the user does not have a ball, and there is no ball around, this method would be called with false, indicating the action (throw) could not be performed. If the user asks the system to perform a command, and the command is successful, the Response class will look at this value and print 'OK' if the action was successful. If unsuccessful, use setMissingInformation() to store what requirements were not set.

Parameters:
status - True if the action was sucessful. False if it failed.

getProcessingStatus

public boolean getProcessingStatus()
Returns the status of the last command run by the system. This is used internally by instructions to test instructions.

Returns:
True if the last command was successful. False otherwise.

addWhichObject

public void addWhichObject(int id)
Adds an object to the list of possible object the user ment.

Parameters:
id - Object id to add.

addReturnObject

public void addReturnObject(int id)
Adds the object the user requested.

Parameters:
id - Object id to set.

setMissingInformation

public void setMissingInformation(int id)
Parameters:
id - Object id

generateResponse

public java.lang.String generateResponse()
After all processing is complete, this method generates a natural language response.

Returns:
String containing the natural language response to the user input.

Fido Alpha 3.2