|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.web_visage.ichat.IChatUserList
public class IChatUserList
Provides a set of operations on the user list.
Provides the following main operations on the user list:
This implementation is thread safe.
Constructor Summary | |
---|---|
IChatUserList()
Constructor. |
Method Summary | |
---|---|
void |
addUser(IChatSender sender,
IChatUserInfo userInfo)
Adds new user to the list. |
void |
addUser(IChatSender aSender,
java.lang.String aNickName,
EnumStatus aStatus)
Adds a new user to the list. |
boolean |
contains(IChatSender aSender)
Checks whether the given user already exists in the user list. |
java.util.Map<IChatSender,IChatUserInfo> |
getSnapshot()
Returns a momentary snapshot of the user map. |
IChatUserInfo |
getUser(IChatSender aSender)
Returns a user information associated with the given sender. |
boolean |
isActive(IChatSender aUser)
Checks whether the given user is active. |
void |
removeAll()
Clears the user list. |
void |
removeInactive()
Removes inactive users from the list. |
void |
removeUser(IChatSender aSender)
Removes given user from the list. |
int |
size()
Returns the number of users in the list. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IChatUserList()
Method Detail |
---|
public void addUser(IChatSender aSender, java.lang.String aNickName, EnumStatus aStatus)
aSender
- -
sender objectaStatus
- -
user statusaNickName
- -
user nicknamepublic void addUser(IChatSender sender, IChatUserInfo userInfo)
userInfo
- -
user info object.public void removeUser(IChatSender aSender)
aSender
- public IChatUserInfo getUser(IChatSender aSender) throws IChatUserNotFoundException
aSender
- -
sender object
IChatUserNotFoundException
public java.util.Map<IChatSender,IChatUserInfo> getSnapshot()
Modifying the resulting map won't affect the original.
Note that this operation is rather expensive, try to avoid its intensive usage.
public void removeInactive()
public boolean isActive(IChatSender aUser) throws java.lang.RuntimeException
aUser
-
java.lang.RuntimeException
public void removeAll()
public boolean contains(IChatSender aSender)
aSender
-
public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |