package rebelsky.hw20; /** * Things like strings that do all of their comparison case-insensitively. * * @author Samuel A. Rebelsky * @version 1.0 of September 2004 */ public class SillyString implements Comparable { String str; public SillyString(String original) { this.str = original; } // SillyString /** * Use case-insensitive comparison. */ public int compareTo(Object other) { return this.str.compareToIgnoreCase(other.toString()); } // compareTo(String) /** * Convert to a string. */ public String toString() { return str; } // toString() } // SillyString