|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.pdx.cs399J.family.FamilyTree
public class FamilyTree
This class represents a family tree. Essentially, it is a collection of people. Family trees are always rooted at the person with id 1.
| Constructor Summary | |
|---|---|
FamilyTree()
Creates an empty family tree. |
|
| Method Summary | |
|---|---|
void |
addPerson(Person person)
Adds a person to this family tree. |
boolean |
containsPerson(int id)
Returns whether or not this family tree contains a person with the given id. |
Collection<Person> |
getPeople()
Returns a collection of Persons that are in this family
tree. |
Person |
getPerson(int id)
Returns a person in this family tree with a given id. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FamilyTree()
| Method Detail |
|---|
public Collection<Person> getPeople()
Persons that are in this family
tree.
public boolean containsPerson(int id)
public Person getPerson(int id)
null is returned.
public void addPerson(Person person)
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||