Inserts the specified number of items at the specified index. The new items will have values equal to the values at those indices before the insertion.
(int index, int count)
| 1552 | /** Inserts the specified number of items at the specified index. The new items will have values equal to the values at those |
| 1553 | * indices before the insertion. */ |
| 1554 | public void insertRange (int index, int count) { |
| 1555 | validateIndex(index); |
| 1556 | int sizeNeeded = size + count; |
| 1557 | if (sizeNeeded > items.length) items = resize(Math.max(Math.max(8, sizeNeeded), (int)(size * 1.75f))); |
| 1558 | System.arraycopy(items, index, items, index + count, size - index); |
| 1559 | size = sizeNeeded; |
| 1560 | } |
| 1561 | |
| 1562 | /** Inserts the character array into this CharArray. Inserting null will use {@code "null"}. |
| 1563 | * @throws IndexOutOfBoundsException if the index is invalid */ |