MCPcopy Index your code
hub / github.com/benfry/processing4 / set

Method set

core/src/processing/data/JSONArray.java:1102–1116  ·  view source on GitHub ↗

Put or replace an object value in the JSONArray. If the index is greater than the length of the JSONArray, then null elements will be added as necessary to pad it out. @param index The subscript. @param value The value to put into the array. The value should be a Boolean, Double, Integer, JSONArr

(int index, Object value)

Source from the content-addressed store, hash-verified

1100 * an invalid number.
1101 */
1102 private JSONArray set(int index, Object value) {
1103 JSONObject.testValidity(value);
1104 if (index < 0) {
1105 throw new RuntimeException("JSONArray[" + index + "] not found.");
1106 }
1107 if (index < this.size()) {
1108 this.myArrayList.set(index, value);
1109 } else {
1110 while (index != this.size()) {
1111 this.append(JSONObject.NULL);
1112 }
1113 this.append(value);
1114 }
1115 return this;
1116 }
1117
1118
1119 /**

Callers 7

setStringMethod · 0.95
setIntMethod · 0.95
setLongMethod · 0.95
setDoubleMethod · 0.95
setBooleanMethod · 0.95
setJSONArrayMethod · 0.95
setJSONObjectMethod · 0.95

Calls 4

testValidityMethod · 0.95
sizeMethod · 0.95
appendMethod · 0.95
setMethod · 0.65

Tested by

no test coverage detected