package eecs2030.test4; import java.util.Set; import java.util.TreeSet; /** * A class that represents a smart phone. Every smart is a telephone * that has a set of contacts. The smart phone and its set of contacts * forms a composition. * * @author EECS2030 Fall 2016-17 * */ public class SmartPhone extends Telephone { // ADD YOUR FIELDS HERE /** * Initializes this smart phone given its telephone number. * * @param number * the telephone number of this phone * @throws IllegalArgumentException * if number does not have 10 digits */ public SmartPhone(long number) { } /** * Initializes this smart phone given its telephone number and a set of * contacts. * * @param number * the telephone number of this phone * @param contacts * a set of contacts for this phone * @throws IllegalArgumentException * if number does not have 10 digits */ public SmartPhone(long number, Set contacts) { } /** * Returns the set of contacts for this phone. The set of contacts for this * phone cannot be modified using the set returned by this method. * * @return the set of contacts for this phone */ public Set getContacts() { } /** * Add a new contact to the set of the contacts for this phone. * If the argument contact is already in this phone's set of * contacts then the set of contacts is not modified. * * @param contact * a contact to add to this phone * @throws Exception * if the phone already has the specified contact in its set of * contacts */ public void addContact(Contact contact) throws Exception { } /** * Call a contact performing the same series of actions as are performed by * Telephone.call(Contact).. Before the contact is called, the phone checks if it * already has the specified contact in its set of contacts. If the contact * is not in the set of contacts for this phone, then the contact is added * to the set of contacts. * * @param contact * a contact to call * @see eecs2030.test4.Telephone#call(eecs2030.test4.Contact) */ @Override public void call(Contact contact) { } /** * Returns a string representation of this smart phone. The returned string * is the phone number (as returned by the Phone version of toString) * followed by the string ", contacts " followed by the set of contacts (as * returned by the Set version of toString()). * * @return a string representation of this smart phone * @see eecs2030.test4.Telephone#toString() */ @Override public String toString() { } }