All pastes #804483 Raw Edit

Stuff

public text v1 · immutable
·published 2007-12-03 15:02 UTC
rendered paste body
    public int createMailBox(String[] users){
         int successfuls = 0;
         for(int i=0; i < users.length; i++){
            String user = users[i];
                if(mailboxes.containsKey(user) == false){
                    mailboxes.put(user, new ArrayList<MailItem>());
                    successfuls++;
                }
            }
         return successfuls;
    }
    
    /**
     * Create mailboxes for one user
     * @param an array containing the names of the new user
     * @return boolean
   */
    public int createMailBox(String user){
        if(mailboxes.containsKey(user) == false){
            mailboxes.put(user, new ArrayList<MailItem>());
            return 1;
        }
        return 0;
   }