MCPcopy Index your code
hub / github.com/killme2008/aviatorscript / put

Method put

src/main/java/com/googlecode/aviator/utils/Env.java:482–496  ·  view source on GitHub ↗

Assign an value, if it's already in overrides, it will update it, otherwise set it to default map. @param key @param value @return previous value for key (from default map, if not present in overrides)

(final String key, final Object value)

Source from the content-addressed store, hash-verified

480 * @return previous value for key (from default map, if not present in overrides)
481 */
482 @Override
483 public Object put(final String key, final Object value) {
484 Object prior = null;
485 Map<String, Object> overrides = getmOverrides(false);
486 if (overrides.containsKey(key)) {
487 prior = overrides.put(key, value);
488 } else {
489 if (this.mDefaults.containsKey(key)) {
490 prior = this.mDefaults.put(key, value);
491 } else {
492 overrides.put(key, value);
493 }
494 }
495 return prior;
496 }
497
498 /**
499 * Add all key-value pairs from another map into the overrides map.

Callers 15

testCallMethod · 0.95
testCallMethod · 0.95
createEnvWithMethod · 0.95
loadModuleMethod · 0.95
testLambdaScopeMethod · 0.45
testLambdaClosureMethod · 0.45
testSpecialVarsMethod · 0.45
callMethod · 0.45
beforeExecuteMethod · 0.45
afterExecuteMethod · 0.45

Calls 2

getmOverridesMethod · 0.95
containsKeyMethod · 0.45

Tested by 15

testCallMethod · 0.76
testCallMethod · 0.76
createEnvWithMethod · 0.76
testLambdaScopeMethod · 0.36
testLambdaClosureMethod · 0.36
testSpecialVarsMethod · 0.36
callMethod · 0.36
beforeExecuteMethod · 0.36
afterExecuteMethod · 0.36
testAnnotationsMethod · 0.36