package sorting; import java.util.Comparator; import java.util.Vector; /** * Things that know how to sort collections of other things. * * @author CSC152 2004F * @version ??? */ public interface Sorter { /* * A method that sorts Vector v by placing the elements of v in ascending order according * to the rules of Comparator c. * * @pre * All elements of v should be acceptable as parameters of c.compare. * @post * The vector is now sorted. That is, for(int i = 1; i < v.size; i++) c.compare(v[i-1],v[i]) <= 0. * @post * Result will be a permutation of v. * @exception * ClassCastException is thrown when elements of v are not accepted as parameters of c. */ public void sort(Vector v, Comparator c) throws ClassCastException; } // interface Sorter