/** * PIMContact class * * a PIMContact includes information about a person, including: * first and last name and email address */ public class PIMContact extends PIMEntity { String firstName; String lastName; String email; /** * default constructor should probably not be used (it sets all the fields * to default values, this is probably not useful...) */ PIMContact() { super(); firstName="default"; lastName="default"; email="default"; } /** * useful constructor, all field values are specified. * * @param first is the first name * @param last is the last name * @param email is the email address * @param priority is the priority string * @param owner is the name of the owner * @param shared indicates whether this is public or private */ PIMContact(String first, String last, String e, String priority, String owner, boolean shared) { super(priority,owner,shared); firstName=first; lastName=last; email = e; } /** * accessor method returns the first name */ public String getFirstName() { return firstName; } /** * accessor method returns the last name */ public String getLastName() { return lastName; } /** * accessor method returns the email address */ public String getEmail() { return email; } /** * method used to change the first name */ public void setFirstName(String fname) { firstName=fname; } /** * method used to change the last name */ public void setLastName(String lname) { lastName=lname; } /** * method used to change the email address */ public void setEmail(String e) { email=e; } /** * returns a string that contains all the fields formatted for printing. */ public String toString() { return "-------PIMContact------\n" + "First Name: " + firstName + "\n" + "Last Name: " + lastName + "\n" + "Email: " + email + "\n" + super.toString(); } }