MCPcopy Index your code
hub / github.com/processing/processing / set

Method set

core/src/processing/data/JSONArray.java:1017–1031  ·  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

1015 * an invalid number.
1016 */
1017 private JSONArray set(int index, Object value) {
1018 JSONObject.testValidity(value);
1019 if (index < 0) {
1020 throw new RuntimeException("JSONArray[" + index + "] not found.");
1021 }
1022 if (index < this.size()) {
1023 this.myArrayList.set(index, value);
1024 } else {
1025 while (index != this.size()) {
1026 this.append(JSONObject.NULL);
1027 }
1028 this.append(value);
1029 }
1030 return this;
1031 }
1032
1033
1034 /**

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