// 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>>();
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 {
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;
}