Commit 130425d
Changed files (1)
src
src/Q1/AddressBook.java
@@ -1,3 +1,8 @@
+/**
+ * Assignment 1, COMP268 Class: AddressBook.java Purpose: Represents a contact from an address book.
+ *
+ * @author: mo khan Student ID: 3431709 Date: May 6, 2019 Version 1.0
+ */
package ca.mokhan.comp268;
import java.util.Objects;
@@ -14,18 +19,49 @@ public class AddressBook implements Comparable<AddressBook> {
private String personalWebSite;
private String skypeId;
+ /** Create a new instance of class AddressBook. Initialize all fields to a blank string. */
public AddressBook() {
this("");
}
+ /**
+ * Create a new instance of class AddressBook. Initialize the firstName and set all other fields
+ * to a blank string.
+ *
+ * @param firstName the first name for the contact.
+ */
public AddressBook(String firstName) {
this(firstName, "", "");
}
+ /**
+ * Create a new instance of class AddressBook. Initialize the first name, middle name and last
+ * name. Set all other fields to a blank string.
+ *
+ * @param firstName the first name of the contact.
+ * @param middleName the middle name of the contact.
+ * @param lastName the last name of the contact.
+ */
public AddressBook(String firstName, String middleName, String lastName) {
this(firstName, middleName, lastName, "", "", "", "", "", "", "");
}
+ /**
+ * Create a new instance of class AddressBook. Initialize the first name, middle name, last name,
+ * business phone number, cell phone number, Facebook Id, home address, home phone number,
+ * personal website and Skype Id of the contact.
+ *
+ * @param firstName the first name of the contact.
+ * @param middleName the middle name of the contact.
+ * @param lastName the last name of the contact.
+ * @param businessPhone the phone number of the contact.
+ * @param cellPhone the cell phone number of the contact.
+ * @param facebookId the Facebook Id of the contact.
+ * @param homeAddress the home address of the contact.
+ * @param homePhone the home phone number of the contact.
+ * @param personalWebSite the website of the contact.
+ * @param skypeId the Skype Id of the contact.
+ */
public AddressBook(
String firstName,
String middleName,
@@ -49,46 +85,101 @@ public class AddressBook implements Comparable<AddressBook> {
this.skypeId = skypeId;
}
+ /**
+ * Returns the business phone number.
+ *
+ * @return the business phone number.
+ */
public String getBusinessPhone() {
return this.businessPhone;
}
+ /**
+ * Returns the cell phone number.
+ *
+ * @return the cell phone number.
+ */
public String getCellPhone() {
return this.cellPhone;
}
+ /**
+ * Returns the Facebook Id.
+ *
+ * @return the Facebook Id
+ */
public String getFacebookId() {
return this.facebookId;
}
+ /**
+ * Returns the first name.
+ *
+ * @return the first name
+ */
public String getFirstName() {
return this.firstName;
}
+ /**
+ * Returns the home address.
+ *
+ * @return the home address
+ */
public String getHomeAddress() {
return this.homeAddress;
}
+ /**
+ * Returns the home phone number.
+ *
+ * @return the phone number
+ */
public String getHomePhone() {
return this.homePhone;
}
+ /**
+ * Returns the last name.
+ *
+ * @return the last name
+ */
public String getLastName() {
return this.lastName;
}
+ /**
+ * Returns the middle name.
+ *
+ * @return the middle name
+ */
public String getMiddleName() {
return this.middleName;
}
+ /**
+ * Returns the personal website.
+ *
+ * @return the website name
+ */
public String getPersonalWebSite() {
return this.personalWebSite;
}
+ /**
+ * Returns the Skype Id.
+ *
+ * @return the skype id
+ */
public String getSkypeId() {
return this.skypeId;
}
+ /**
+ * Sets the business phone number.
+ *
+ * @param value The new phone number.
+ */
public void setBusinessPhone(String value) {
this.businessPhone = value;
}