예제 #1
0
 /**
  * modify a user in OnlineUsers.
  *
  * @param user the user wanted to modify
  */
 public void modifyUser(User userModify) {
   for (User user : arrayList) {
     if (user.getUid() == userModify.getUid()) {
       user = userModify;
       return;
     }
   }
   pushBack(userModify);
 }
예제 #2
0
 /**
  * Remove a user from OnlineUsers.
  *
  * @param uid the uid of the user wanted to remove
  */
 public void removeUser(long uid) {
   for (User user : arrayList) {
     if (user.getUid() == uid) {
       arrayList.remove(user);
       return;
     }
   }
 }
예제 #3
0
 /**
  * Find a user from OnlineUsers.
  *
  * @param uid the uid of the user wanted to find
  */
 public User findUser(long uid) {
   for (User user : arrayList) {
     if (user.getUid() == uid) return user;
   }
   return null;
 }