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

Method isTrue

src/main/java/field/utility/Dict.java:552–561  ·  view source on GitHub ↗
(Prop<?> prop, boolean def)

Source from the content-addressed store, hash-verified

550 }
551
552 public boolean isTrue(Prop<?> prop, boolean def) {
553 if (!dictionary.containsKey(prop)) return def;
554
555 Object p = dictionary.get(prop);
556 if (p == null) return def;
557 if (p instanceof Boolean) return ((Boolean) p);
558 if (p instanceof Number) return ((Number) p).intValue() > 0;
559 if (p instanceof String) return ((String) p).length() > 0;
560 return true;
561 }
562
563
564 public <T> Dict put(Prop<T> key, T value) {

Callers 15

drawMethod · 0.95
OpenClass · 0.80
DefaultMenusMethod · 0.80
FrameManipulationMethod · 0.80
onMouseDownMethod · 0.80
button2Method · 0.80
button0Method · 0.80
setSelectionToMethod · 0.80
singleChildrenForMethod · 0.80
transformPart1Method · 0.80
MarkingMenusMethod · 0.80
asMap_setMethod · 0.80

Calls 3

getMethod · 0.65
containsKeyMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected