import PersonalProfileInterface; import java.util.Date; /** * An implementation of PersonalProfile that can be used for testing. * * @author Khong Lovan * @version 1.1 of October 1999 */ public class PersonalProfile implements PersonalProfileInterface { // +--------+-------------------------------------------------------------- // | Fields | // +--------+ /** The user's name. */ Name userFullName; /** The user's address. */ StreetAddress address; /** The user's gender. */ String gender; /** The user's birthdate. */ Date birthDate; /** The user's phone number. */ String phoneNumber; //+--------------+---------------------------------------------------------- //| Constructors | //+--------------+ /** * This constructor takes no parameter and builds a personal profile. */ public PersonalProfile() { } /** * This constructor takes a name object and builds a personal profile. */ public PersonalProfile(Name name) { userFullName = name; } // +------------+---------------------------------------------------------- // | Extractors | // +------------+ /** * Get the user's name. * Pre: None. * Post: Returns the user's name. * Return type: Name. * Throws no exceptions. */ public Name getUserFullName() { Name userFullName = new Name("First Name", "Middle Name", "Last Name"); return userFullName; } // getUserFullName() /** * Get the user's address. * Pre: None. * Post: Returns the user's address. * Return type: StreetAddress. * Throws no exceptions. */ public StreetAddress getAddress() { StreetAddress address = new StreetAddress("8888 8th Street", "Grinnell", "IA" ); return address; } // getAddress() /** * Get the user's gender. * Pre: None. * Post: Returns the user's gender. * Return type: String. * Throws no exceptions. */ public String getGender() { return "gender"; } // getGender() /** * Get the user's date of birth. * Pre: None. * Post: Returns the user's date of birth. * Return type: SimpleDate. * Throws no exceptions. */ public Date getDateOfBirth() { Date birthDate = new Date(10, 28, 79); return birthDate; } // getDateOfBirth() /** * Get the user's phone number. * Pre: None. * Post: Returns the user's phone number. * Return type: String. * Throws no exceptions. */ public String getPhoneNumber() { return "888-888-888"; } // getPhoneNumber() // +-----------+---------------------------------------------------------- // | Modifiers | // +-----------+ /** * Set the user's name. * Pre: None. * Post: Changes the user's name according to the given parameter. */ public void setUserFullName(Name userName) { this.userFullName = userName; } // setUserFullName(Name userFullName) /** * Set the user's address. * Pre: None. * Post: Changes the user's address according to the given parameter. */ public void setAddress(StreetAddress address) { this.address = address; } // setAddress(StreetAddress address) /** * Set the user's gender. * Pre: None. * Post: Changes the user's gender according to the given parameter. */ public void setGender(String gender) { this.gender = gender; } // setGender(String gender) /** * Set the user's date of birth. * Pre: None. * Post: Changes the user's date of birth according to the given parameter. */ public void setDateOfBirth(Date DateOfBirth) { this.birthDate = DateOfBirth; } // setDateOfBirth(SimpleDate birthDate) /** * Set the user's phone number. * Pre: None. * Post: Changes the user's phone number according to the given parameter. */ public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } // setPhoneNumber(String phoneNumber) /** * Combines all informatin into one string. */ public String toString(){ return "this is a stub."; } }// class PersonalProfile