keepalive.communication
Class Input
java.lang.Object
|
+--keepalive.communication.Input
- All Implemented Interfaces:
- Receiver, java.lang.Runnable
- public class Input
- extends java.lang.Object
- implements java.lang.Runnable, Receiver
Accept an incoming stream of characters.
Constructor Summary |
Input(AbstractSocket sock,
java.lang.String participantName)
Create a new Input object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Input
public Input(AbstractSocket sock,
java.lang.String participantName)
- Create a new Input object.
- Parameters:
sock
- The socket through which we will receive the incoming stream.participantName
- The name of the "user" of this class; for
debugging purposes.
run
public void run()
- Receive messages line by line; pass each incoming message
to the MessageListener
- Specified by:
run
in interface java.lang.Runnable
lastTimeStamp
public long lastTimeStamp()
- Get time stamp for incoming messages. From Receiver interface
- Specified by:
lastTimeStamp
in interface Receiver
- Returns:
- the time stamp of the last message received.
setMessageListener
public void setMessageListener(MessageListener listener)
- Set the call-back object for received messages. Mutator method.
From Receiver interface,
- Specified by:
setMessageListener
in interface Receiver
- Following copied from interface:
keepalive.communication.Receiver
- Parameters:
listener
- the call back object.
setMessageDisplayer
public void setMessageDisplayer(MessageDisplayer ui)
- Set the object that displays messages. Mutator method.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object