/**
 * Root class for a simple inheritanc ehierarchy.
 * This class has both public and private methods.
 * Student extends this class.
 *
 * @author Mark Young (A00000000)
 */
public class Person implements Comparable<Person> {

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

    /** 
     * Person requires a name. 
     * 
     * @param n this Person's requested name
     */
    public Person(String n) {
        this.name = n;
    }

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

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

    /** 
     * Print this Person's name when the Person gets printed.
     * 
     * @return this Person's name
     */
    @Override
    public String toString() {
        return name;
    }

    /**
     * Compare this Person to that one by comparing their names.
     * 
     * @param that the Person to compare to
     * @return negative if this Person comes before that one; positive if that
     * one comes before this one; and zero if their order doesn't matter
     */
    @Override
    public int compareTo(Person that) {
        return this.name.compareTo(that.name);
    }

}
