39 |
|
* |
40 |
|
* <pre> |
41 |
|
* class GraphVisitor extends LinkedAsyncAction { |
42 |
< |
* final Node node; |
43 |
< |
* GraphVisitor(GraphVistor parent, Node node) { |
44 |
< |
* super(parent); this.node = node; |
45 |
< |
* } |
46 |
< |
* protected void compute() { |
47 |
< |
* if (node.mark.compareAndSet(false, true)) { |
48 |
< |
* for (Edge e : node.edges()) { |
49 |
< |
* Node dest = e.getDestination(); |
50 |
< |
* if (!dest.mark.get()) |
51 |
< |
* new GraphVisitor(this, dest).fork(); |
52 |
< |
* } |
53 |
< |
* visit(node); |
54 |
< |
* } |
55 |
< |
* complete(); |
42 |
> |
* final Node node; |
43 |
> |
* GraphVisitor(GraphVistor parent, Node node) { |
44 |
> |
* super(parent); this.node = node; |
45 |
> |
* } |
46 |
> |
* protected void compute() { |
47 |
> |
* if (node.mark.compareAndSet(false, true)) { |
48 |
> |
* for (Edge e : node.edges()) { |
49 |
> |
* Node dest = e.getDestination(); |
50 |
> |
* if (!dest.mark.get()) |
51 |
> |
* new GraphVisitor(this, dest).fork(); |
52 |
> |
* } |
53 |
> |
* visit(node); |
54 |
> |
* } |
55 |
> |
* complete(); |
56 |
|
* } |
57 |
|
* } |
58 |
|
* </pre> |