import IncomparableException;
import StringComparator;
import Quicksortable;
import SimpleOutput;

/**
 * A test of the AltQuicksortable class.  Sorts the strings on the command
 * line and then prints them out.
 *
 * @author Samuel A. Rebelsky
 * @version 1.0 of October 1999
 */
public class TestQS3 {
  /** Do the testing. 
   *
   * @exception IncomparableException
   *   Never, since StringComparator never throws one, but it's
   *   easier to claim that we might throw one since it seems that
   *   the sort method might.
   */
  public static void main(String[] args)
    throws IncomparableException
  {
    // Prepare for output.
    SimpleOutput out = new SimpleOutput();
    // Build the array for sorting.
    AltQuicksortable stuff = new AltQuicksortable(args);
    // Sort!
    stuff.sort(new StringComparator(),out);
    // And print it out.
    for (int i = 0; i < stuff.size(); ++i) {
      out.println(i + ": " + stuff.get(i));
    } // for
  } // main(String[])
} // class TestQS3

