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)
| 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 | /** |
no test coverage detected