sclass CIString implements Comparable, CharSequence { char[] data; // could be final except for persistence *() {} *(char[] s) { data = String.valueOf(assertNotNull(s)); } *(S s) { data = toCharArray(s); } // note that eq(s, cistring) is still false public bool equals(Object o) { if (o cast CIString) ret eqicCharArrays(data, o.data); /*if (o instanceof String) // One-way interoperability! return s.equalsIgnoreCase((String) o);*/ false; } public int compareTo(CIString cis) { ret compareCharArraysIC(data, cis.data); } toString { ret str(data); } public char charAt(int index) { ret data[index]; } public int length() { ret data.length; } public CharSequence subSequence(int start, int end) { ret CIString(subCharArray(data, start, end)); } }