/** * CSE 373, Winter 2011, Jessica Miller * The PrintJob class represents a simple request to a printer. We used this * class to show how to implement/write an object that implements the * Comparable interface. */ public class PrintJob implements Comparable{ private String user; private int number; private int priority; public PrintJob(int number, String user, int priority) { this.number = number; this.user = user; this.priority = priority; } public int compareTo(PrintJob other) { return priority - other.priority; } public String toString() { return this.number + " (" + user + "):" + this.priority; } }