package edu.vt.marian.common; import java.util.*; import java.io.*; import edu.vt.marian.common.*; /** * A quicksort object which can be used to sort the elements of * an enumeration in either non-increasing or non-decreasing order. * The only requirement is that each element of the object being * sorted implements the Sortable interface. Basically, this means * an object provides a compare() method which can be used to * determine whether one object is less than, equal to, or greater * than another object. * * @author Paul Mather * @version 0.9 */ public interface Sortable { /** Indicate that we want to sort in non-decreasing order */ public final static int INCREASING = 1; /** Indicate that we want to sort in non-increasig order */ public final static int DECREASING = 2; /** * Magic number to indicate object being compared against us is * less than our value */ public final static int LESS = -1; /** * Magic number to indicate object being compared against us is * equal to our value */ public final static int EQUAL = 0; /** * Magic number to indicate object being compared against us is * greater than our value */ public final static int GREATER = 1; /** * Magic number to indicate object being compared against us is * incomparable to us. */ public final static int INCOMPARABLE = 23; /** * Compare an object with ourselves and return an int indicating * how it compares relative to us. The int is returned as follows: *