|
User |
|
1 // joi/7/juno/User.java 2 // 3 // 4 // Copyright 2003 Ethan Bolker and Bill Campbell 5 6 /** 7 * Model a Juno user. Each User has a login name, 8 * a home directory, and a real name. 9 * 10 * @version 7 11 */ 12 13 public class User 14 { 15 private String name; // the User's login name 16 private Directory home; // her home Directory 17 private String realName; // her real name 18 19 /** 20 * Construct a new User. 21 * 22 * @param name the User's login name. 23 * @param home her home Directory. 24 * @param realName her real name. 25 */ 26 27 public User( String name, Directory home, String realName ) 28 { 29 this.name = name; 30 this.home = home; 31 this.realName = realName; 32 } 33 34 /** 35 * Get the User's login name. 36 * 37 * @return the name. 38 */ 39 40 public String getName() 41 { 42 return name; 43 } 44 45 /** 46 * Convert the User to a String. 47 * The String representation for a User is her 48 * login name. 49 * 50 * @return the User's name. 51 */ 52 53 public String toString() 54 { 55 return getName(); 56 } 57 58 /** 59 * Get the User's home Directory. 60 * 61 * @return the home Directory. 62 */ 63 64 public Directory getHome() 65 { 66 return home; 67 } 68 69 /** 70 * Get the user's real name. 71 * 72 * @return the real name. 73 */ 74 75 public String getRealName() 76 { 77 return realName; 78 } 79 } 80
|
User |
|