X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FForest.java;h=636ad4f08af8c101d3db45b78628422ec5fcfe02;hp=795f3a04151737daea1c9400dddee08e605aa984;hb=24219bdf084b45273e869cd19382d1640b396566;hpb=584cef55d8811e3215858fde22e708d2a3d1cf70 diff --git a/src/edu/berkeley/sbp/Forest.java b/src/edu/berkeley/sbp/Forest.java index 795f3a0..636ad4f 100644 --- a/src/edu/berkeley/sbp/Forest.java +++ b/src/edu/berkeley/sbp/Forest.java @@ -1,4 +1,4 @@ -// Copyright 2006 all rights reserved; see LICENSE file for BSD-style license +// Copyright 2006-2007 all rights reserved; see LICENSE file for BSD-style license package edu.berkeley.sbp; import edu.berkeley.sbp.util.*; @@ -37,7 +37,7 @@ public abstract class Forest implements GraphViz.ToGraphViz { abstract void expand(HashSet> ht, HashSet> ignore, Tree bogus); abstract void gather(HashSet> ignore); - abstract void edges(GraphViz.Node n); + abstract void edges(GraphViz.StateNode n); boolean ambiguous() { return false; } // One ////////////////////////////////////////////////////////////////////////////// @@ -97,16 +97,16 @@ public abstract class Forest implements GraphViz.ToGraphViz { public boolean isTransparent() { return false; } public boolean isHidden() { return false; } - public GraphViz.Node toGraphViz(GraphViz gv) { + public GraphViz.StateNode toGraphViz(GraphViz gv) { if (gv.hasNode(this)) return gv.createNode(this); - GraphViz.Node n = gv.createNode(this); + GraphViz.StateNode n = gv.createNode(this); n.label = headToString()==null?"":headToString(); n.directed = true; edges(n); return n; } boolean edges = false; // FIXME ?? - public void edges(GraphViz.Node n) { + public void edges(GraphViz.StateNode n) { if (edges) return; edges = true; for(int i=0; i implements GraphViz.ToGraphViz { public boolean isTransparent() { return hp.size()==1; } public boolean isHidden() { return hp.size()==0; } - public void edges(GraphViz.Node n) { + public void edges(GraphViz.StateNode n) { if (hp.size()==1) { hp.iterator().next().edges(n); return; } for(Forest f : hp) f.edges(n); } - public GraphViz.Node toGraphViz(GraphViz gv) { + public GraphViz.StateNode toGraphViz(GraphViz gv) { if (hp.size()==1) return hp.iterator().next().toGraphViz(gv); if (gv.hasNode(this)) return gv.createNode(this); - GraphViz.Node n = gv.createNode(this); + GraphViz.StateNode n = gv.createNode(this); n.label = "?"; n.color = "red"; for(Forest f : hp) n.edge(f, null);