MCPcopy
hub / github.com/libgdx/libgdx / insert

Method insert

gdx/src/com/badlogic/gdx/utils/CharArray.java:1526–1538  ·  view source on GitHub ↗

Inserts the value into this CharArray. @throws IndexOutOfBoundsException if the index is invalid

(int index, boolean value)

Source from the content-addressed store, hash-verified

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);

Callers 1

insertTestMethod · 0.95

Calls 8

validateIndexMethod · 0.95
requireMethod · 0.95
appendTrueMethod · 0.95
appendFalseMethod · 0.95
getCharsMethod · 0.80
valueOfMethod · 0.45
toStringMethod · 0.45
lengthMethod · 0.45

Tested by 1

insertTestMethod · 0.76