/**
 * An example that uses the Ordered interface.
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class Driver
{

    public static void main(String[] args)
    {
	AccidentReport[]     reports;
        AccidentReport       largest;        
	
        reports    = new AccidentReport[3];
        reports[0] = new AccidentReport("FENDER BENDER", 2);
        reports[1] = new AccidentReport("OVERTURNED TRACTOR-TRAILER", 8);
        reports[2] = new AccidentReport("HEAD ON", 2);

        // Note that the max() returns an Ordered which must be
        // typecast as an AccidentReport if any methods in that
        // class are to be used
        largest = (AccidentReport)Statistics.max(reports);

        System.out.printf("%s\t(%d)\n", 
                          largest.toString(), largest.getPriority());
    }
}
