public void onUserJoined(IrcUser user) { userList.add(user); nickUserMap.put(user.nick, user); user.addObserver(this); updateTopic(); }
public void setUserList(List<IrcUser> userList) { if (userList != null && userList.size() > 0) { for (IrcUser user : userList) { user.deleteObserver(this); } } this.userList = userList; nickUserMap.clear(); for (IrcUser user : userList) { nickUserMap.put(user.nick, user); user.addObserver(this); } updateTopic(); }