Advertisement
heavenriver

Utility.java (path: ../login/impl)

May 26th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. /**
  2.   * Implements the Login interface. Defines a file-based set of accounts.
  3.   */
  4.  
  5. package login.impl;
  6. import login.*;
  7.  
  8. public class Utility
  9.     {
  10.    
  11.     /**
  12.       * Returns a given account's access credentials if the given access parameters match one of the given account array entries.
  13.       * @param login The username associated to the account.
  14.       * @param password The password associated to the account.
  15.       * @param v The account credentials array.
  16.       * @return The given account's access credentials, if present.
  17.       */
  18.    
  19.     public static Login login(String login, String password, Login[] v)
  20.         {
  21.         for(int i = 0; i < v.length; i++)
  22.             if(v[i].login(login, password) != null) return v[i];
  23.         return null;
  24.         }
  25.    
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement