package eecs2030.test4; import java.util.List; import java.util.NoSuchElementException; import java.util.ArrayList; /** * A class that represents a smart phone. Every smart is a telephone that has a * call log. A call log is a list of contacts that have been called using this * smart phone. The order of contacts in the call log are from the * The smart phone and its call log form a composition. * * @author EECS2030 Fall 2016-17 * */ public class SmartPhone2 extends Telephone { // ADD YOUR FIELDS HERE /** * Initializes this smart phone given its telephone number. * The call log for this smart phone is initialized as an empty list. * * * @param number * the telephone number of this phone * @throws IllegalArgumentException * if number does not have 10 digits */ public SmartPhone2(long number) { } /** * Initializes this smart phone by copying the telephone number and call log * of another smart phone. * * @param other * the smart phone to copy */ public SmartPhone2(SmartPhone2 other) { } /** * Returns the call log for this phone. The call log for this phone cannot * be modified using the call log returned by this method. * * @return the call log for this phone */ public List getCallLog() { } /** * Call a contact. After the contact is called, the contact is added to the * call log. * * @param contact * a contact to call * @see eecs2030.test4.Telephone#call(eecs2030.test4.Contact) */ @Override public void call(Contact contact) { } /** * Returns a new copy of the last contact that was called using this smart * phone. If the call log for this is empty, then a NoSuchElementException * is thrown. * * @return a new copy of the last contact that was called using this smart * phone * @throws NoSuchElementException * if the call log for this smart phone is empty */ public Contact lastCalled() { } /** * 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 ", call log " followed by the call log (as * returned by the List version of toString()). * * @return a string representation of this smart phone * @see eecs2030.test4.Telephone#toString() */ @Override public String toString() { } }