package username.sorting; import java.util.Comparator; import java.util.Vector; /** * Things that can sort vectors and return new sorted vectors. * * @author Samuel A. Rebelsky * @version 1.0 of May 2005 */ public interface OutOfPlaceVectorSorter { /** * Sort a vector using a particular comparator. * * @param * vec, a Vector * @param * c, a Comparator * @return * sorted, a sorted Vector * @pre * The comparator can be applied to any pair of elements * in the original vector. * @post * c.compare(sorted.get(i),sorted.get(i+1)) < 0 for all * "reasonable" values of i. * sorted is a permutation of vec */ public Vector sort(Vector vec, Comparator c); } // interface OutOfPlaceVectorSorter