/**
 * Contains a name and an array of email addresses.
 * @author Khong Lovan
 * @author Elias Vafiadis
 * @author Anthony Nakaar
 * @author Wanlin Liu
 * version 2.0 of October, 1999
 */

public class Address {
    
    //+--------+---------------------------------------------------------------
    //| Fields |
    //+--------+
    
    /* A name of the person who can be reached at the email address(es). */
    Name name;

    /* A list of email addresses. */
    String[] emailAddress;

    //+--------------+--------------------------------------------------------
    //| Constructors |
    //+--------------+

    public Address (Name nme, String emailAdd){
        name = nme;
        emailAddress = new String[4];
        emailAddress[0] = emailAdd;
    } // getName

    //+------------+----------------------------------------------------------
    //| Extractors |
    //+------------+

    /**
     * Purpose: returns the name of the user.
     * Parameters: no parameters.
     * Pre: it has to be initialized.
     * Post: none.
     * Return Type: an object.
     * Problems: throws no exception.
     */
    public Name getName() {
        return (new Name("First", "Last"));
    }//getName()

    /**
     * Purpose: returns the email address of the user.
     * Parameters: no parameters.
     * Pre: it has to be initialized.
     * Post: none.
     * Return Type: a string.
     * Problems: throws no exception.
     */
    public String[] getEmailAddress() {
        String[] stub = {"vafiadis@grinnell.edu","rebelsky@grinnell.edu"};
        return stub;
    }//getEmailAddress()

    //+-----------+---------------------------------------------------------
    //| Modifiers |
    //+-----------+    

    /**
     * Purpose: modifies the name of the user.
     * Parameters: no parameters.
     * Pre: it has to be initialized - there must be a name entered already.
     * Post: takes the original name and returns the modified one.
     * Return Type: none.
     * Problems: throws no exception.
     */
    public void setName() {
    }//setName()

    /**
     * Purpose: modifies the email address of the user.
     * Parameters: no parameters.
     * Pre: it has to be initialized - there must be an email address already.
     * Post: takes the original email address and returns the modified one.
     * Return Type: none.
     * Problems: throws no exception.
     */
    public void setEmailAddress() {
    }//setEmailAddress()

    //+--------------+------------------------------------------------------
    //| Capabilities |
    //+--------------+

    /**
     * Purpose: converts any information into a string.
     * Parameters: no parameters.
     * Pre: it has to be initialized.
     * Post: takes any information and returns the string version of it.
     * Return Type: a string.
     * Problems: throws no exception.
     */
    public String toString() {
        return "SamR";
    }//toString()

} // class Address

