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

Method putToMap

src/main/java/field/utility/Dict.java:652–662  ·  view source on GitHub ↗
(Prop<? extends Map<String, T>> key, K tok, T value)

Source from the content-addressed store, hash-verified

650 }
651
652 public <K, T> Dict putToMap(Prop<? extends Map<String, T>> key, K tok, T value) {
653 if (key.toCanon().autoConstructor != null) {
654 Map<K, T> c = (Map<K, T>) dictionary.computeIfAbsent(key, (k) -> key.toCanon().autoConstructor.get());
655 c.put(tok, value);
656 return this;
657 } else {
658 Map<K, T> c = (Map<K, T>) dictionary.computeIfAbsent(key, (k) -> new IdempotencyMap<T>(null));
659 c.put(tok, value);
660 return this;
661 }
662 }
663
664 public <K, T> T getFromMap(Prop<? extends Map<String, T>> key, K tok) {
665 Map<K, T> c = (Map<K, T>) get(key);

Callers 15

beginMethod · 0.80
DefaultMenusMethod · 0.80
FrameManipulationMethod · 0.80
button0Method · 0.80
feedbackMethod · 0.80
WatchesMethod · 0.80
MarkingMenusMethod · 0.80
showMethod · 0.80
FLineDrawingClass · 0.80
FLineInteractionMethod · 0.80
DrawingMethod · 0.80

Calls 4

toCanonMethod · 0.80
computeIfAbsentMethod · 0.80
getMethod · 0.65
putMethod · 0.45

Tested by 1

selectMethod · 0.64