import IncomparableException; import StringComparator; import Quicksortable; import SimpleOutput; /** * A test of the Quicksortable class. Sorts integer values presented * on the command line and then prints them out. Based closely on * TestQS.java by Samuel A. Rebelsky (version 1.0 accessed 15 October * 1999 in the CS152 Web site). * * Changes: * * Class name * * Type of comparator used * * Note about what kind of exception is thrown * * @author Samuel A. Rebelsky * @version 1.0 of October 1999 */ public class TestQS2 { /** Do the testing. * * @exception IncomparableException * When the command line parameters are not all integers. */ public static void main(String[] args) throws IncomparableException { // Prepare for output. SimpleOutput out = new SimpleOutput(); // Build the array for sorting. NewQuicksortable stuff = new NewQuicksortable(args); // Sort! stuff.sort(new SmartIntegerComparator()); // And print it out. for (int i = 0; i < stuff.size(); ++i) { out.println(i + ": " + stuff.get(i)); } // for } // main(String[]) } // class TestQS2