|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Server.User
Each instance of the User class is an end-user, working as a client. note: user is uniquily identified by both its internet address and its name.
Field Summary | |
private java.net.InetAddress |
inetAddress
The internet address of the user. |
private SocketThread |
socketThread
The socket this user is attached to. |
private java.lang.String |
userName
The name of the user. |
Constructor Summary | |
(package private) |
User(java.net.InetAddress inetAddress,
java.lang.String userName)
A constructor. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
An overriden equals() for this object. |
java.net.InetAddress |
getInetAddress()
Returns the internet address of the user |
SocketThread |
getSocketThread()
Returns the SocketThread associated with this user |
int |
hashCode()
An overriden hashCode() for this object. |
void |
setSocketThread(SocketThread thread)
Set the SocketThread associated with this user |
java.lang.String |
toString()
Returns the name of the user |
Methods inherited from class java.lang.Object |
|
Field Detail |
private final java.net.InetAddress inetAddress
private final java.lang.String userName
private SocketThread socketThread
Constructor Detail |
User(java.net.InetAddress inetAddress, java.lang.String userName)
inetAddress
- The address of the user.userName
- The name of the user.Method Detail |
public java.lang.String toString()
toString
in class java.lang.Object
public java.net.InetAddress getInetAddress()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public SocketThread getSocketThread()
public void setSocketThread(SocketThread thread)
thread
- The SocketThread to save
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |