| 314 | } |
| 315 | |
| 316 | public void getChars(int srcStart, int srcEnd, char[] dst, int dstStart) { |
| 317 | if (srcStart < 0 || srcEnd > length) { |
| 318 | throw new IndexOutOfBoundsException(); |
| 319 | } |
| 320 | |
| 321 | flush(); |
| 322 | |
| 323 | int index = length; |
| 324 | for (Cell c = chain; c != null; c = c.next) { |
| 325 | int start = index - c.value.length(); |
| 326 | int end = index; |
| 327 | index = start; |
| 328 | |
| 329 | if (start < srcStart) { |
| 330 | start = srcStart; |
| 331 | } |
| 332 | |
| 333 | if (end > srcEnd) { |
| 334 | end = srcEnd; |
| 335 | } |
| 336 | |
| 337 | if (start < end) { |
| 338 | c.value.getChars(start - index, end - index, |
| 339 | dst, dstStart + (start - srcStart)); |
| 340 | } |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | public String toString() { |
| 345 | char[] array = new char[length]; |