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

Method Out

src/main/java/fielded/plugins/Out.java:53–286  ·  view source on GitHub ↗
(Box root_unused)

Source from the content-addressed store, hash-verified

51 long t = 0;
52
53 public Out(Box root_unused) {
54 this.properties.put(__out, this);
55
56 this.properties.put(out, x -> {
57 if (t == RunLoop.tick)
58 return doOutput(x, true);
59 else {
60 t = RunLoop.tick;
61 return doOutput(x, false);
62 }
63 });
64 this.properties.put(outClear, x -> {
65 return doOutput(x, false);
66 });
67 this.properties.put(outAppend, x -> {
68 return doOutput(x, true);
69 });
70
71 this.properties.put(outMap, output.map);
72
73 // setup some defaults
74
75 output.map._put("[F", x -> {
76 String s = "{HTML}";
77 if (((float[]) x).length == 0) {
78 s += "<table class='maptable' cellspacing=0>";
79 s += "<i>Empty Array of Floats" + shorten(x.getClass()) + "</i>";
80 s += "</table>";
81 return s;
82 }
83 float[] k = ((float[]) x);
84
85 s += "<div class='maptable' cellspacing=0><div class='smaller-inframe'>Float Array, len " + k.length + "</div>";
86 int num = 0;
87 for (Float oo : k) {
88 s += "<div class='maptable-entry'> <div class='maptable-value'>" + output.convert(oo, "value") + "</div></div>";
89 num++;
90 if (num > 10 && k.length > 15) {
91 s += "<div class='maptable-entry'><div class='maptable-key'> ... </div> <div class='maptable-value'> " + num + "/" + k.length + " total </div></div>";
92 break;
93 }
94
95 }
96 s += "</div>";
97
98 return s;
99 });
100
101 output.map._put("[D", x -> {
102 String s = "{HTML}";
103 if (((double[]) x).length == 0) {
104 s += "<table class='maptable' cellspacing=0>";
105 s += "<i>Empty Array of Floats" + shorten(x.getClass()) + "</i>";
106 s += "</table>";
107 return s;
108 }
109 double[] k = ((double[]) x);
110

Callers

nothing calls this directly

Calls 15

doOutputMethod · 0.95
shortenMethod · 0.95
describeMethod · 0.95
safeMethod · 0.95
nonAnonymousMethod · 0.95
formatDoubleMethod · 0.95
joinContextMethod · 0.80
isFunctionMethod · 0.80
getMethod · 0.65
putMethod · 0.45
_putMethod · 0.45
convertMethod · 0.45

Tested by

no test coverage detected