projects
/
sbp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
815430f
)
checkpoint
author
adam
<adam@megacz.com>
Sun, 16 Jul 2006 07:05:23 +0000
(
03:05
-0400)
committer
adam
<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
patch
|
blob
|
history
diff --git
a/src/edu/berkeley/sbp/Forest.java
b/src/edu/berkeley/sbp/Forest.java
index
3795c9a
..
0fb10c6
100644
(file)
--- a/
src/edu/berkeley/sbp/Forest.java
+++ b/
src/edu/berkeley/sbp/Forest.java
@@
-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" */
// 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>>();
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();
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 {
}
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);
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;
}
f2.add(ff);
hp = f2;
}