edu.harvard.deas.hyperenc
Class Contact

java.lang.Object
  extended by edu.harvard.deas.hyperenc.Contact
All Implemented Interfaces:
Serializable

public class Contact
extends Object
implements Serializable

Represents a communication partner for hyper-encryption. Each Contact has a name and an e-mail address; each Contact should be uniquely identified by its e-mail address. That is, no two Contacts should be created with the same e-mail address.

Contacts are immutable.

See Also:
Serialized Form

Constructor Summary
Contact(String fullName, Address email, String displayName)
          Create a new Contact.
 
Method Summary
 boolean equals(Object o)
          Compares this Contact to the given Object.
 String getDisplayName()
          Returns the display name of this contact.
 Address getEmail()
          Returns the e-mail address of this contact.
 String getFullName()
          Returns the name of this contact.
 int hashCode()
           
 String toString()
          Returns a String representation of this Contact.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Contact

public Contact(String fullName,
               Address email,
               String displayName)
Create a new Contact.

Parameters:
fullName - Full name of this contact
email - E-mail address for this contact
displayName - Display name for this contact
Method Detail

getFullName

public String getFullName()
Returns the name of this contact.

Returns:
the name of this contact

getEmail

public Address getEmail()
Returns the e-mail address of this contact.

Returns:
the e-mail address of this contact

getDisplayName

public String getDisplayName()
Returns the display name of this contact. The display name is the name that is displayed in places where an abbreviated or more casual name is desired. (But the display name is not required to have any particular relationship to the full name.)

Returns:
the displayName

toString

public String toString()
Returns a String representation of this Contact.

Overrides:
toString in class Object
Returns:
a String representation of this Contact

equals

public boolean equals(Object o)
Compares this Contact to the given Object. Returns true iff o is a Contact with an e-mail address equal to this Contact's e-mail address.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object