5 * @author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
7 final class CharSeq implements CharSequence {
13 public CharSeq(int c) {
20 public CharSeq(char[] arr, int off, int len) {
28 return arr == null ? 1 : len;
31 public char charAt(int index) {
33 throw new IndexOutOfBoundsException();
37 throw new IndexOutOfBoundsException();
42 throw new IndexOutOfBoundsException();
44 return arr[off + index];
48 public CharSequence subSequence(int start, int end) {
49 if (end >= this.len) {
50 throw new IndexOutOfBoundsException();
52 char[] array = arr == null ? new char[]{ (char)c } : arr;
53 return new CharSeq(array, off + start, off + end);