
/**
 * Root class for a simple inheritance hierarchy.
 * This class has both public and private methods.
 * Student extends this class.
 *
 * @author Mark Young (A00000000)
 */
public class Person {

    /** Every Person has a name */
    private String name;

    /** Person requires a name */
    public Person(String n) {
        this.name = n;
    }

    /** return this Person's name */
    public String getName() {
        return this.name;
    }

    /** Change this Person's name */
    public void setName(String nn) {
        this.name = nn;
    }

    /** A method for children classes to inherit */
    public void publicPersonMethod() {
        System.out.println("\tin publicPersonMethod for " + this.name);
    }

    /** A method for children classes to inherit */
    public void callingPrivatePersonMethod() {
        System.out.println("\tin callingPrivatePersonMethod for " + this.name);
        privatePersonMethod();
        System.out.println("\tcallingPrivatePersonMethod done");
    }

    /** A method children classes can't call *directly* */
    private void privatePersonMethod() {
        System.out.println("\t\tin privatePersonMethod for " + this.name);
    }

    /** A method for children classes to replace entirely. */
    public void replacedMethod() {
        System.out.println("\tin replacedMethod for Person " + this.name);
    }

    /** A method for children classes to add to. */
    public void revisedMethod() {
        System.out.println("\tin revisedMethod for Person " + this.name);
    }

    /** A method to represent this Person using a String */
    @Override
    public String toString() {
        return name;
    }

}
