Inserts the value into this CharArray. @throws IndexOutOfBoundsException if the index is invalid
(int index, boolean value)
| 1524 | /** Inserts the value into this CharArray. |
| 1525 | * @throws IndexOutOfBoundsException if the index is invalid */ |
| 1526 | public CharArray insert (int index, boolean value) { |
| 1527 | validateIndex(index); |
| 1528 | if (value) { |
| 1529 | require(TRUE_STRING_SIZE); |
| 1530 | System.arraycopy(items, index, items, index + TRUE_STRING_SIZE, size - index); |
| 1531 | appendTrue(index); |
| 1532 | } else { |
| 1533 | require(FALSE_STRING_SIZE); |
| 1534 | System.arraycopy(items, index, items, index + FALSE_STRING_SIZE, size - index); |
| 1535 | appendFalse(index); |
| 1536 | } |
| 1537 | return this; |
| 1538 | } |
| 1539 | |
| 1540 | public void insert (int index, char value) { |
| 1541 | validateIndex(index); |