// overloads runDFS(GraphNode source) public void runDFS(GraphNode source, NodeVisitor visitor) { // do traversing, then visitor.visit(node); }
@Override public void accept(NodeVisitor visitor) throws Exception { visitor.visit(this); if (this.children != null && this.children.length > 0) { for (int i = 0; i < this.children.length; i++) { this.children[i].accept(visitor); } } }
@Override public void accept(NodeVisitor visitor) throws Exception { visitor.visit(this); if (this.children != null && this.children.length > 0) { for (int i = 0; i < this.children.length; i++) { this.children[i].accept(visitor); } } }
@Override public void accept(NodeVisitor visitor) throws Exception { visitor.visit(this); if (this.children != null && this.children.length > 0) { for (int i = 0; i < this.children.length; i++) { this.children[i].accept(visitor); } } }
@Override public void accept(NodeVisitor visitor) throws Exception { visitor.visit(this); if (this.children != null && this.children.length > 0) { for (int i = 0; i < this.children.length; i++) { this.children[i].accept(visitor); } } }
public void accept(NodeVisitor visitor) throws Exception { visitor.visit(this); if (this.children != null && this.children.length > 0) { for (int i = 0; i < this.children.length; i++) { this.children[i].accept(visitor); } } }
@Override public void accept(NodeVisitor visitor) throws Exception { visitor.visit(this); if (this.children != null && this.children.length > 0) { for (int i = 0; i < this.children.length; i++) { this.children[i].accept(visitor); } } }