MCPcopy Create free account
hub / github.com/cschanck/single-file-java / Graph

Class Graph

src/main/java/org/sfj/DrawDot.java:320–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318 }
319
320 public static class Graph implements Child, Commentable<Graph> {
321 private final String name;
322 private boolean clustered = false;
323 private boolean directed = true;
324 private final ArrayList<Child> children = new ArrayList<>();
325 private final ArrayList<Connection> connections = new ArrayList<>();
326 private RankDir rankDir = null;
327 private final List<String> commentsBefore = new LinkedList<>();
328 private final List<String> commentsAfter = new LinkedList<>();
329 private final List<String> commentsHeader = new LinkedList<>();
330 private final List<String> commentsFooter = new LinkedList<>();
331
332 public Graph(String name) {
333 this.name = name;
334 }
335
336 public List<Child> getChildren() {
337 return children;
338 }
339
340 public List<Connection> getConnections() {
341 return connections;
342 }
343
344 public Graph clustered(boolean clustered) {
345 this.clustered = clustered;
346 return this;
347 }
348
349 @Override
350 public List<String> getCommentsBefore() {
351 return commentsBefore;
352 }
353
354 @Override
355 public List<String> getCommentsAfter() {
356 return commentsAfter;
357 }
358
359 public Graph commentHeader(String... lines) {
360 this.commentsHeader.addAll(Arrays.asList(lines));
361 return this;
362 }
363
364 public Graph commentFooter(String... lines) {
365 this.commentsFooter.addAll(Arrays.asList(lines));
366 return this;
367 }
368
369 public Graph directed(boolean directed) {
370 this.directed = directed;
371 return this;
372 }
373
374 public Graph rankdir(RankDir dir) {
375 this.rankDir = dir;
376 return this;
377 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected