|
Fido Alpha 3.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fido.response.Response
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:
Ex1:
Fido> Throw the ball to John.
OK
Ex2:
Fido> Throw the ball to John.
Thrown.
Ex3:
Fido> Throw the ball to John.
The ball was thrown to John
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 |
public Response()
Method Detail |
public void reset()
public void setYesNoResponse(boolean response)
public void setProcessingStatus(boolean status)
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.
status
- True if the action was sucessful. False
if it failed.public boolean getProcessingStatus()
public void addWhichObject(int id)
id
- Object id to add.public void addReturnObject(int id)
id
- Object id to set.public void setMissingInformation(int id)
id
- Object idpublic java.lang.String generateResponse()
|
Fido Alpha 3.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |