Methods Summary |
---|
public void | addMessage(ChatMessage chatMessage)
if (messages.size() > MAX_CHAT_MESSAGES) {
// messages.remove(messages.size() - 1);
messages.remove(0);
}
messages.add(chatMessage);
|
public User | findMember(java.lang.String name)
assert(name != null);
return members.get(name);
|
public java.util.List | getChatMessages()
return new ArrayList<ChatMessage>(messages);
|
public java.util.Date | getCreationDate()
return creationDate;
|
public java.lang.String | getDescription()
return description;
|
public java.util.List | getMembers()
return new ArrayList<User>(members.values());
|
public java.lang.String | getName()
return name;
|
public boolean | hasMember(java.lang.String name)
assert(name != null);
return members.containsKey(name);
|
public void | memberEnter(User member)
assert(member != null);
if (! hasMember(member.getName())) {
members.put(member.getName(), member);
}
|
public void | memberExit(java.lang.String memberName)
assert(memberName != null);
assert(memberName.trim().length() > 0);
members.remove(memberName);
|