MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / asMap_set

Method asMap_set

src/main/java/field/graphics/FLine.java:2417–2457  ·  view source on GitHub ↗
(String name, Object value)

Source from the content-addressed store, hash-verified

2415// if (value instanceof ConsString) value = value.toString();
2416 if (value != null && value.getClass().getName().endsWith("ConsString")) value = "" + value;
2417
2418 Dict.Prop canon = new Dict.Prop(name).toCanon();
2419 Object converted = convert(value, canon.getTypeInformation());
2420
2421 attributes.put(canon, converted);
2422
2423 if (value instanceof ThreadSync2.TrappedSet) {
2424 Object firstValue = ((ThreadSync2.TrappedSet) value).next();
2425
2426 Object r = asMap_set(name, firstValue);
2427
2428 Drivers.provokeCurrentFibre(System.identityHashCode(this) + "_" + name, new Function1<Object, Object>() {
2429
2430 Object was = null;
2431
2432 @Override
2433 public Object invoke(Object o) {
2434 if (o != null && !safeEq(was, o)) {
2435 was = o;
2436 modify();
2437 asMap_set(name, o);
2438 }
2439 return o;
2440 }
2441 }, ((ThreadSync2.TrappedSet) value));
2442
2443 return r;
2444 }
2445
2446 modify();
2447
2448
2449 return this;
2450 }
2451
2452 @Override
2453 public Object asMap_new(Object b, Object c) {
2454 throw new NoSuchMethodError(" two argument constructor to node not implemented");
2455 }
2456
2457 @HiddenInAutocomplete
2458 public Object convert(Object value, List<Class> fit) {
2459 return Conversions.convert(value, fit);
2460

Callers 3

invokeMethod · 0.95
asMap_callMethod · 0.95
asMap_newMethod · 0.95

Calls 8

convertMethod · 0.95
provokeCurrentFibreMethod · 0.95
modifyMethod · 0.95
toCanonMethod · 0.80
getTypeInformationMethod · 0.80
nextMethod · 0.65
getNameMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected