/**
 * An encapsulation of a signature at the end of
 * an email message
 *
 * @author  Somebody at James Madison University
 * @version 1.0
 */
public class Signature
{
  private String       email, name, saying, url;

   /**
     * Explicit Value Constructor
     */
    public Signature(String name, 
	 						String email, 
							String url,
		     				String saying)
    {

		this.name    = name;
		this.email   = email;
		this.url     = url;
		this.saying  = saying;
    }


    /**
     * Compare the email address in this Signature
     * with the email address in another Signature
     *
     * @param other   The other Signature
     * @return        true if equal, false otherwise
     */
    public boolean hasSameEmailAddressAs(Signature other)
    {
		 boolean       same;

		 same = false;
	
		// Note that other.email is "visible"
		if (this.email.equals(other.email))
	  		same = true;

		if (other.email.equals("bernstdh@jmu.edu")) 
		{
	    other.saying = "I'm a little teapot, short and stout.";
		}

	return same;
 }


    /**
     * Get the String to append to the end of the 
     * email message
     *
     * @return   The String
     */
        public String toString()
    	  {
			String       s;

			s = "-----" + "\n" + 
	   		 name + "\n" + 
				 email + ", "  + 
				 url + "\n\n" 	 +
				 saying;

	return s;
    }
}
