|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectPerson
This class is a simple record for a person consisting of the person's name, date of birth, and date of death. There must be a date of birth, but there may be no date of death (indicating that the person is still alive).
| Constructor Summary | |
Person(Person original)
This is the copy constructor for the Person class. |
|
Person(String initialName,
DateClass birthDate,
DateClass deathDate)
This constructor receives the person's name, birthdate and date of death. |
|
| Method Summary | |
boolean |
equals(Person otherPerson)
This method checks to see if two Person objects contain the same data. |
DateClass |
getBirthDate()
|
DateClass |
getDeathDate()
|
String |
getName()
These are accessor methods for the name, birthdate and date of death. |
void |
set(String newName,
DateClass birthDate,
DateClass deathDate)
This mutator method sets the name, birthdate, and date of death. |
void |
setBirthDate(DateClass newDate)
This mutator method sets the birtdate. |
void |
setBirthYear(int newYear)
This mutator method sets the birth year. |
void |
setDeathDate(DateClass newDate)
This mutator method sets the death date. |
void |
setDeathYear(int newYear)
This mutator method sets the date of death. |
void |
setName(String newName)
This mutator method sets the name. |
String |
toString()
This method returns a string containing the person's name followed by their dates of birth & death. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Person(String initialName,
DateClass birthDate,
DateClass deathDate)
public Person(Person original)
| Method Detail |
public void set(String newName,
DateClass birthDate,
DateClass deathDate)
public String toString()
public boolean equals(Person otherPerson)
public void setBirthDate(DateClass newDate)
public void setDeathDate(DateClass newDate)
public void setName(String newName)
public void setBirthYear(int newYear)
public void setDeathYear(int newYear)
public String getName()
public DateClass getBirthDate()
public DateClass getDeathDate()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||