|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object addressbook.Person
public class Person
An object of this class maintains information about a single individual in the address book
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, with ties broken by name |
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 - attributes specified individually |
Method Summary | |
---|---|
boolean |
contains(java.lang.String criterion)
Test to see whether this person contains a search criterion |
java.lang.String |
getAddress()
Accessor for the person's address |
java.lang.String |
getCity()
Accessor for the person's city |
java.lang.String |
getFullName()
Get the full name of a person in the form last, first |
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 |
---|
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)
firstName
- the person's first namelastName
- the person's last nameaddress
- the person's addresscity
- the person's citystate
- the person's statezip
- the person's zipphone
- the person's phoneMethod Detail |
---|
public java.lang.String getFullName()
public java.lang.String getAddress()
public java.lang.String getCity()
public java.lang.String getState()
public java.lang.String getZip()
public java.lang.String getPhone()
public void update(java.lang.String address, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String phone)
address
- the person's new addresscity
- the person's new citystate
- the person's new statezip
- the person's new zipphone
- the person's new phonepublic boolean contains(java.lang.String criterion)
criterion
- the search criterion
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |