package rebelsky.sorting; import java.util.Comparator; /** * A Comparator that compares Integers in increasing order. * * @author Samuel A. Rebelsky * @version 1.0 of November 2004 */ public class IncreasingIntegerComparator implements Comparator { public int compare(Object o, Object p) throws ClassCastException { return compare((Integer) o, (Integer) p); } // compare(Object, Object) public int compare(Integer o, Integer p) { return o.intValue() - p.intValue(); } // compare(Integer, Integer) } // class IncreasingIntegerComparator