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

Method put

core/src/processing/data/JSONObject.java:1319–1340  ·  view source on GitHub ↗

Put a key/value pair in the JSONObject. If the value is null, then the key will be removed from the JSONObject if it is present. @param key A key string. @param value An object which is the value. It should be of one of these types: Boolean, Double, Integer, JSONArray, JSONObject, Long, String,

(String key, Object value)

Source from the content-addressed store, hash-verified

1317 * or if the key is null.
1318 */
1319 public JSONObject put(String key, Object value) {
1320 String pooled;
1321 if (key == null) {
1322 throw new RuntimeException("Null key.");
1323 }
1324 if (value != null) {
1325 testValidity(value);
1326 pooled = (String)keyPool.get(key);
1327 if (pooled == null) {
1328 if (keyPool.size() >= keyPoolSize) {
1329 keyPool = new HashMap<>(keyPoolSize);
1330 }
1331 keyPool.put(key, key);
1332 } else {
1333 key = pooled;
1334 }
1335 this.map.put(key, value);
1336 } else {
1337 this.remove(key);
1338 }
1339 return this;
1340 }
1341
1342
1343 /**

Callers 15

setStringMethod · 0.95
setIntMethod · 0.95
setLongMethod · 0.95
setFloatMethod · 0.95
setDoubleMethod · 0.95
setBooleanMethod · 0.95
setJSONObjectMethod · 0.95
setJSONArrayMethod · 0.95
putOnceMethod · 0.95
StringDictMethod · 0.45
resetIndicesMethod · 0.45
createMethod · 0.45

Calls 4

testValidityMethod · 0.95
removeMethod · 0.95
getMethod · 0.65
sizeMethod · 0.45

Tested by

no test coverage detected