|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectClient
public class Client
Holds personal information needs to communicate with a given client.
Field Summary | |
---|---|
static char |
LINE_RETURN
|
Constructor Summary | |
---|---|
Client(java.net.Socket connection)
initializes an output stream to the client |
Method Summary | |
---|---|
java.lang.String |
getUserName()
Gets the user name of the client |
void |
run()
Overrided run method that listens for incoming messages from the client. |
boolean |
sendMsg(java.lang.String message)
Sends a message to a client |
void |
setRoom(Room room)
|
void |
setUserName(java.lang.String userName)
Sets the user name |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char LINE_RETURN
Constructor Detail |
---|
public Client(java.net.Socket connection)
connection
- A socket to for the clientMethod Detail |
---|
public boolean sendMsg(java.lang.String message)
message
- The message that is to be sent
public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
userName
- Sets the user name to the given namepublic void run()
run
in interface java.lang.Runnable
public void setRoom(Room room)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |