9 package javolution.text;
60 private static final char[]
NO_CHAR =
new char[0];
68 _array =
new char[capacity];
77 _array =
string.toCharArray();
132 public final int indexOf(java.lang.CharSequence csq) {
133 final char c = csq.charAt(0);
134 final int csqLength = csq.length();
137 boolean match =
true;
138 for (
int j = 1; j < csqLength; j++) {
139 if (
_array[i + j] != csq.charAt(j)) {
144 if (match) {
return i -
_offset; }
205 if (that instanceof String) {
206 return equals((String) that);
209 }
else if (that instanceof java.lang.CharSequence) {
210 return equals((java.lang.CharSequence) that);
217 private boolean equals(java.lang.CharSequence chars) {
220 if (this._length != chars.length())
223 if (
_array[--j] != chars.charAt(i))
241 if (this._length != that.
_length)
243 final char[] thatArray = that.
_array;
245 if (
_array[j] != thatArray[--i])
266 if (
_array[--j] != str.charAt(i))
370 if ((index < 0) || (index >=
_length))
371 throw new IndexOutOfBoundsException(
"index: " + index);
377 if ((start < 0) || (end < 0) || (start > end) || (end > this.
length()))
378 throw new IndexOutOfBoundsException();
387 public void getChars(
int start,
int end,
char dest[],
int destPos) {
388 if ((start < 0) || (end < 0) || (start > end) || (end >
_length))
389 throw new IndexOutOfBoundsException();
390 System.arraycopy(
_array, start +
_offset, dest, destPos, end - start);