X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FForest.java;h=0fb10c6cbf3b442a36eb27f61bd4c4c59854cbfe;hp=3795c9ad19d5cdb17a2a72d9f9d1195567a82086;hb=fd03b595963d781ee0a86961631854d2b0089397;hpb=815430f1fa820e28981bf4cff3fe15a4b9f5d97d diff --git a/src/edu/berkeley/sbp/Forest.java b/src/edu/berkeley/sbp/Forest.java index 3795c9a..0fb10c6 100644 --- a/src/edu/berkeley/sbp/Forest.java +++ b/src/edu/berkeley/sbp/Forest.java @@ -119,7 +119,7 @@ public abstract class Forest implements GraphViz.ToGraphViz { // Many ////////////////////////////////////////////////////////////////////////////// /** An "ambiguity node"; this is immutable once it has been "looked at" */ - public static class Many extends Forest { + public static class Many extends Forest implements Iterable> { HashSet parents = new HashSet(); private FastSet> hp = new FastSet>(); @@ -129,7 +129,7 @@ public abstract class Forest implements GraphViz.ToGraphViz { public Iterator> iterator() { touched(); - return (Iterator>)hp.iterator(); // FIXME: fastset's iterator is not safe! + return (Iterator>)(Object)hp.iterator(); // FIXME: fastset's iterator is not safe! } public Tree expand1() throws Ambiguous { @@ -163,7 +163,7 @@ public abstract class Forest implements GraphViz.ToGraphViz { FastSet> f2 = new FastSet>(); for(Forest f : hp) if (f instanceof Forest.One) f2.add(f); - else for(Forest ff : ((Forest.Many)f)) + else for(Forest ff : ((Forest.Many)f)) f2.add(ff); hp = f2; }