Class Person

java.lang.Object
  extended byPerson
All Implemented Interfaces:
java.io.Serializable

public class Person
extends java.lang.Object
implements java.io.Serializable

An object of this class maintains information about a single individual in the address book

See Also:
Serialized Form

Nested Class Summary
static class Person.CompareByName
          Comparator for comparing two persons by alphabetical order of name
static class Person.CompareByZip
          Comparator for comparing two persons by order of zip code
 
Constructor Summary
Person(java.lang.String firstName, java.lang.String lastName, java.lang.String address, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String phone)
          Constructor
 
Method Summary
 java.lang.String getAddress()
          Accessor for the person's address
 java.lang.String getCity()
          Accessor for the person's city
 java.lang.String getFirstName()
          Accessor for the person's first name
 java.lang.String getLastName()
          Accessor for the person's last name
 java.lang.String getPhone()
          Accessor for the person's phone
 java.lang.String getState()
          Accessor for the person's state
 java.lang.String getZip()
          Accessor for the person's zip
 void update(java.lang.String address, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String phone)
          Update the person with new information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Person

public Person(java.lang.String firstName,
              java.lang.String lastName,
              java.lang.String address,
              java.lang.String city,
              java.lang.String state,
              java.lang.String zip,
              java.lang.String phone)
Constructor

Parameters:
firstName - the person's first name
lastName - the person's last name
address - the person's address
city - the person's city
state - the person's state
zip - the person's zip
phone - the person's phone
Method Detail

getFirstName

public java.lang.String getFirstName()
Accessor for the person's first name

Returns:
the person's first name

getLastName

public java.lang.String getLastName()
Accessor for the person's last name

Returns:
the person's last name

getAddress

public java.lang.String getAddress()
Accessor for the person's address

Returns:
the person's address

getCity

public java.lang.String getCity()
Accessor for the person's city

Returns:
the person's city

getState

public java.lang.String getState()
Accessor for the person's state

Returns:
the person's state

getZip

public java.lang.String getZip()
Accessor for the person's zip

Returns:
the person's zip

getPhone

public java.lang.String getPhone()
Accessor for the person's phone

Returns:
the person's phone

update

public void update(java.lang.String address,
                   java.lang.String city,
                   java.lang.String state,
                   java.lang.String zip,
                   java.lang.String phone)
Update the person with new information. Note that the name cannot be changed, but the other information can be

Parameters:
address - the person's new address
city - the person's new city
state - the person's new state
zip - the person's new zip
phone - the person's new phone