+class Node<OtherNode extends Node>
+ implements IntegerMappable,
+ GraphViz.ToGraphViz {
+
+ protected FastSet<OtherNode> predecessors = new FastSet<OtherNode>();
+ protected FastSet<OtherNode> successors = new FastSet<OtherNode>();
+ //private HashSet<OtherNode> predecessors = new HashSet<OtherNode>();
+ //private HashSet<OtherNode> successors = new HashSet<OtherNode>();
+
+ // GraphViz //////////////////////////////////////////////////////////////////////////////
+
+ public GraphViz.StateNode toGraphViz(GraphViz gv) {
+ if (gv.hasNode(this)) return gv.createNode(this);
+ GraphViz.StateNode n = gv.createNode(this);
+ /*
+ n.label = ""+f;
+ n.shape = "rectangle";
+ //if (pred()!=null) n.edge(pred, "");
+ n.color = "blue";
+ if (phase() != null)
+ ((GraphViz.Group)phase().toGraphViz(gv)).add(n);
+ n.label = "state["+state.toInt()+"]";
+ n.shape = "rectangle";
+ boolean haspreds = false;
+ for(ResultNode r : results) n.edge(r, "");
+ n.color = state.doomed ? "red" : "green";
+ ((GraphViz.Group)phase().toGraphViz(gv)).add(n);
+ */
+ return n;
+ }
+ public boolean isTransparent() { return false; }
+ public boolean isHidden() { return false; }
+
+ // IntegerMappable ////////////////////////////////////////////////////////////
+
+ private static int node_idx = 0;
+ private final int idx = node_idx++;
+ public int toInt() { return idx; }