import java.util.*;
final class ResultNode
- implements GraphViz.ToGraphViz {
+ extends Node<StateNode> {
private Forest.Many f = new Forest.Many();
- //private HashSet<StateNode> predecessors = new HashSet<StateNode>();
- //private HashSet<StateNode> successors = new HashSet<StateNode>();
- private FastSet<StateNode> predecessors = new FastSet<StateNode>();
- private FastSet<StateNode> successors = new FastSet<StateNode>();
private boolean destroyed = false;
private boolean primordeal;
private int usedByNonDoomedNode = 0;
private Pos reduction;
private GSS.Phase predPhase;
- public boolean predecessorsContains(StateNode n) {
- return predecessors.contains(n);
- }
public Pos reduction() { return reduction; }
public void merge(Forest newf) {
this.f.merge(newf);
*/
}
- public boolean noSuccessors() { return successors.size()==0; }
-
public GSS.Phase phase() { return predPhase; }
public Forest getForest() { return f; }
- public Iterable<StateNode> getPreds() { return predecessors; }
public void addSucc(StateNode succ) {
if (successors.contains(succ)) return;
successors.add(succ);
if (pred != null) addPred(pred);
}
- // 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);
- return n;
- }
- public boolean isTransparent() { return false; }
- public boolean isHidden() { return false; }
}
\ No newline at end of file