My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.wchou.adg
{
public class Node
{
public var name:String;

public var method:Function;

public var callback:Function;

public var traversed:Boolean;

public var edgeTo:Vector.<Node>;

public function Node(name:String, method:Function, callback:Function)
{
this.name = name;
this.method = method;
this.callback = callback;

traversed = false;

edgeTo = new Vector.<Node>();
}

public function connectTo(node:Node):void
{
edgeTo.push(node);
}

public function disconnectFrom(node:Node):void
{
var i:int = edgeTo.indexOf(node);

if (i >= 0)
edgeTo.splice(i, 1);
}

public function hasEdgeFrom(nodes:Vector.<Node>):Boolean
{
for each (var otherNode:Node in nodes)
{
if (otherNode.edgeTo.indexOf(this) >= 0)
return true;
}

return false;
}
}
}

Change log

r51 by wc...@cornell.edu on Sep 26, 2010   Diff
ASYNC_DEPENDENCY_GRAPH:
Initial commit.
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 979 bytes, 50 lines
Powered by Google Project Hosting