/* StringSorterLexico.java ** An instance of this class has methods (inherited from its parent) ** by which to sort an array (or a segment thereof) into ascending order ** using the classic Selection Sort algorithm. What this class provides ** is the isLessThan() method, which simply calls the String class's ** compareTo() method for the purpose of making isLessThan()'s results ** consistent with lexicographic ordering upon Strings. */ public class StringSorterLexico extends Sorter { /* Returns true iff s1 < s2 according to the String class's compareTo() ** method, which implements the lexicographic ordering relation. */ protected boolean isLessThan(String s1, String s2) { return s1.compareTo(s2) < 0; } }