MCPcopy Create free account
hub / github.com/LFYSec/MScan / dumpElement

Method dumpElement

src/main/java/pascal/taie/util/graph/DotDumper.java:167–186  ·  view source on GitHub ↗

Dumps an element (either a node or an edge). @param elem element to be dumped @param toString function that returns string representation of elem @param labeler function that returns label of elem @param attributer function that returns attributes of elem @param <

(T elem,
                                 Function<T, String> toString,
                                 Function<T, String> labeler,
                                 Function<T, DotAttributes> attributer)

Source from the content-addressed store, hash-verified

165 * @param <T> type of the element
166 */
167 private <T> void dumpElement(T elem,
168 Function<T, String> toString,
169 Function<T, String> labeler,
170 Function<T, DotAttributes> attributer) {
171 out.print(INDENT);
172 out.print(toString.apply(elem));
173 String label = labeler.apply(elem);
174 DotAttributes attrs = attributer.apply(elem);
175 if (label != null || attrs != null) {
176 out.print(" [");
177 if (label != null) {
178 out.printf("label=\"%s\",", label);
179 }
180 if (attrs != null) {
181 out.print(attrs);
182 }
183 out.print(']');
184 }
185 out.println(';');
186 }
187}

Callers 2

dumpNodeMethod · 0.95
dumpEdgeMethod · 0.95

Calls 2

applyMethod · 0.65
printMethod · 0.45

Tested by

no test coverage detected