start of new file
[IRC.git] / Robust / src / IR / Flat / FlatNode.java
index b624516da2f3925be2a897aa8199ae61c8275096..714b894bfad3ba57e37519aab8c23afa324e2109 100644 (file)
@@ -11,7 +11,7 @@ public class FlatNode {
     }
 
     public String toString() {
-       throw new Error();
+       throw new Error(this.getClass().getName() + "does not implement toString!");
     }
     public int numNext() {
        return next.size();
@@ -31,6 +31,15 @@ public class FlatNode {
        next.add(n);
        n.addPrev(this);
     }
+
+    /** This function modifies the graph */
+    public void setNext(int i, FlatNode n) {
+       FlatNode old=getNext(i);
+       next.set(i, n);
+       old.prev.remove(this);
+       n.addPrev(this);
+    }
+
     protected void addPrev(FlatNode p) {
        prev.add(p);
     }