org.alicebot.server.core.responder
Class TextResponder

java.lang.Object
  extended by org.alicebot.server.core.responder.TextResponder
All Implemented Interfaces:
Responder

public class TextResponder
extends java.lang.Object
implements Responder

Logs output of all chat.

Author:
Jon Baer, Thomas Ringate, Pedro Colla, Noel Bush

Field Summary
protected static java.lang.String SPACE
          A space, for convenience.
 
Constructor Summary
TextResponder()
          Creates a new TextResponder using encoding for System.in.
 
Method Summary
 java.lang.String append(java.lang.String input, java.lang.String response, java.lang.String appendTo)
          Simply appends the response to appendTo.
 void log(java.lang.String input, java.lang.String reply, java.lang.String hostname, java.lang.String userid, java.lang.String botid)
          Logs an input/response pair to the appropriate place.
 java.lang.String postprocess(java.lang.String reply)
          Simply returns the reply.
 java.lang.String preprocess(java.lang.String input, java.lang.String hostname)
          Returns the input, converted into Unicode from the request encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPACE

protected static final java.lang.String SPACE
A space, for convenience.

See Also:
Constant Field Values
Constructor Detail

TextResponder

public TextResponder()
Creates a new TextResponder using encoding for System.in.

Method Detail

preprocess

public java.lang.String preprocess(java.lang.String input,
                                   java.lang.String hostname)
Returns the input, converted into Unicode from the request encoding.

Specified by:
preprocess in interface Responder
Parameters:
input - the input
hostname - not used
Returns:
the input

append

public java.lang.String append(java.lang.String input,
                               java.lang.String response,
                               java.lang.String appendTo)
Simply appends the response to appendTo.

Specified by:
append in interface Responder
Parameters:
input - an input from the client
response - a reply from the bot
appendTo - the string to which the client of the Responder may expect the reply to be appended
Returns:
the reply, in whatever fashion the Responder has decided to modify it

log

public void log(java.lang.String input,
                java.lang.String reply,
                java.lang.String hostname,
                java.lang.String userid,
                java.lang.String botid)
Description copied from interface: Responder
Logs an input/response pair to the appropriate place.

Specified by:
log in interface Responder
Parameters:
input - the client's input
reply - the bot's response
hostname - the name of the host

postprocess

public java.lang.String postprocess(java.lang.String reply)
Simply returns the reply.

Specified by:
postprocess in interface Responder
Parameters:
reply - the reply from the bot to be processed
Returns:
the reply