FileDocCategorySizeDatePackage
Person.javaAPI DocExample1331Tue Dec 12 18:59:20 GMT 2000None

Person

public class Person extends Object

Fields Summary
Person
father
Person
mother
Vector
children
private String
name
Constructors Summary
public Person(String name)

        this.name = name;
        mother = father = null;
        children = new Vector();
    
Methods Summary
public PersongetChildAt(int i)

        return (Person)children.elementAt(i);
    
public intgetChildCount()

 return children.size(); 
public PersongetFather()

 return father; 
public intgetIndexOfChild(Person kid)

        return children.indexOf(kid);
    
public PersongetMother()

 return mother; 
public java.lang.StringgetName()

 return name; 
public static voidlinkFamily(Person pa, Person ma, Person[] kids)
Link together all members of a family.

param
pa the father
param
ma the mother
param
kids the children

        int len = kids.length;
        Person kid = null;
        for (int i = 0; i < len; i++) {
            kid = kids[i];
            pa.children.addElement(kid);
            ma.children.addElement(kid);
            kid.father = pa;
            kid.mother = ma;
        }
    
public java.lang.StringtoString()

 return name;