1 package;
2 import haxe.ds.ObjectMap;
3 class Graph<T> {
4
5 private var _outbound:ObjectMap<GraphArc, GraphNode<T>>;
6 private var _inbound:ObjectMap<GraphArc, GraphNode<T>>;
7
8
9 // A multi-key map where source and target nodes are keys and a grapharc instance is the value
10 private var srcTargetMap:ObjectMap<GraphNode<T>, ObjectMap<GraphNode<T>, GraphArc>>;
11
12
13 // Content to node map
14 private var contentNodeMap:ObjectMap<T, GraphNode<T>>;
15
16
17 public function new() {
18 srcTargetMap = new ObjectMap<GraphNode<T>, ObjectMap<GraphNode<T>, GraphArc>>();
19 contentNodeMap = new ObjectMap<T, GraphNode<T>>();
20 _outbound = new ObjectMap<GraphArc, GraphNode<T>>();
21 _inbound = new ObjectMap<GraphArc, GraphNode<T>>();
22 }
23
24
25 }