|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--Chat.HostList
Maintains a list of other chat users, as well as local user information.
Provides a thread-safe simultaneous iterating and updating of the list.
Sender
and Receiver
hold a pointer to the
instance of this class.
Sender
,
Receiver
, Serialized FormInner Class Summary | |
(package private) class |
HostList.HostItem
A data-storage class representing an item in the list of remote users. |
(package private) class |
HostList.HostIterator
A custom thread-safe iterator over the list. |
Inner classes inherited from class java.util.Map |
java.util.Map.Entry |
Field Summary | |
(package private) Console |
console
A link to the console - used solely for updating the user list. |
(package private) HostList.HostItem |
me
Information about this (local) user. |
(package private) java.util.TreeSet |
nicks
A separately maintained list of nicknames for updating the console user list. |
Fields inherited from class java.util.Hashtable |
count, emptyEnumerator, emptyIterator, ENTRIES, entrySet, KEYS, keySet, loadFactor, modCount, serialVersionUID, table, threshold, values, VALUES |
Constructor Summary | |
(package private) |
HostList(Console console)
Initializes the host list with the link to console. |
Method Summary | |
(package private) void |
add(java.lang.String nick,
java.lang.String host,
int port)
Adds a remote user to hostlist. |
void |
clear()
Clears the hostlist. |
(package private) void |
delete(java.lang.String nick)
Deletes a remote user from hostlist. |
(package private) java.util.Iterator |
iterator()
|
(package private) void |
setIdentity(java.lang.String nick,
java.lang.String host,
int port)
Sets the identity of local user. |
Methods inherited from class java.util.Hashtable |
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait |
Field Detail |
final Console console
final java.util.TreeSet nicks
HostList.HostItem me
Constructor Detail |
HostList(Console console)
console
- link to console.Method Detail |
void setIdentity(java.lang.String nick, java.lang.String host, int port)
nick
- user nicknamehost
- user hostname (IP adress)port
- user portvoid add(java.lang.String nick, java.lang.String host, int port)
nick
- user nicknamehost
- user hostname (IP adress)port
- user portvoid delete(java.lang.String nick)
nick
- user nicknamepublic void clear()
clear
in class java.util.Hashtable
java.util.Iterator iterator()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |