// CSE 143, Winter 2009, Daniel Otero // A TA object represents one teaching assistant. They are Comparable so they // can be stored into a priority queue. public class TA implements Comparable { private String name; private int experience; public TA(String name, int experience) { this.name = name; this.experience = experience; } public String getName() { return name; } public int getExperience() { return experience; } // Returns string containing name and number of quarters public String toString() { return name + " (" + experience + "q)"; } public int compareTo(TA other) { // Doesn't guarantee any particular quarter in the case that // two TAs have the same number of quarters' experience. return this.getExperience() - other.getExperience(); } }