/** * 获得此组用户 * * @param userId 用户Id * @return 用组中有用户id为userId的用户,返回他,否则返回空 */ public UserPo getUser(String userId) { UserPo up = null; for (UserPo _up : userList) { if (_up.getUserId().equals(userId)) { up = _up; break; } } return up; }
public void addOneUser(UserPo up) { for (UserPo _up : userList) { if (up.getUserId().equals(_up.getUserId())) return; } userList.add(up); }