MCPcopy
hub / github.com/libgdx/libgdx / insertRange

Method insertRange

gdx/src/com/badlogic/gdx/utils/Array.java:196–202  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

194 /** Inserts the specified number of items at the specified index. The new items will have values equal to the values at those
195 * indices before the insertion. */
196 public void insertRange (int index, int count) {
197 if (index > size) throw new IndexOutOfBoundsException("index can't be > size: " + index + " > " + size);
198 int sizeNeeded = size + count;
199 if (sizeNeeded > items.length) items = resize(Math.max(Math.max(8, sizeNeeded), (int)(size * 1.75f)));
200 System.arraycopy(items, index, items, index + count, size - index);
201 size = sizeNeeded;
202 }
203
204 public void swap (int first, int second) {
205 if (first >= size) throw new IndexOutOfBoundsException("first can't be >= size: " + first + " >= " + size);

Callers

nothing calls this directly

Calls 2

resizeMethod · 0.95
maxMethod · 0.45

Tested by

no test coverage detected