checkpoint
authoradam <adam@megacz.com>
Sun, 16 Jul 2006 07:05:23 +0000 (03:05 -0400)
committeradam <adam@megacz.com>
Sun, 16 Jul 2006 07:05:23 +0000 (03:05 -0400)
darcs-hash:20060716070523-5007d-5f8a263cb08fa99bb644bf68a32a9d234e9d5f74.gz

src/edu/berkeley/sbp/Forest.java

index 3795c9a..0fb10c6 100644 (file)
@@ -119,7 +119,7 @@ public abstract class Forest<T> implements GraphViz.ToGraphViz {
     // Many //////////////////////////////////////////////////////////////////////////////
 
     /** An "ambiguity node"; this is immutable once it has been "looked at" */
-    public static class Many<T> extends Forest<T> {
+    public static class Many<T> extends Forest<T> implements Iterable<One<T>> {
 
         HashSet<GSS.Phase.Node> parents = new HashSet<GSS.Phase.Node>();
         private FastSet<Forest<T>> hp = new FastSet<Forest<T>>();
@@ -129,7 +129,7 @@ public abstract class Forest<T> implements GraphViz.ToGraphViz {
 
         public Iterator<One<T>> iterator() {
             touched();
-            return (Iterator<One<T>>)hp.iterator();    // FIXME: fastset's iterator is not safe!
+            return (Iterator<One<T>>)(Object)hp.iterator();    // FIXME: fastset's iterator is not safe!
         }
 
         public Tree<T> expand1() throws Ambiguous {
@@ -163,7 +163,7 @@ public abstract class Forest<T> implements GraphViz.ToGraphViz {
             FastSet<Forest<T>> f2 = new FastSet<Forest<T>>();
             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<T>)f))
                     f2.add(ff);
             hp = f2;
         }