start of new file
[IRC.git] / Robust / src / IR / Flat / FlatPrefetchNode.java
index 81a20d1d3fa5c0970ed2c09b8d9353bfde953299..4baaf6adfa4a288eb2f0198e95b858e61717ed7a 100644 (file)
@@ -3,14 +3,25 @@ import Analysis.Prefetch.*;
 import java.util.*;
 
 public class FlatPrefetchNode extends FlatNode {
+    public Integer siteid;
        HashSet<PrefetchPair> hspp;
 
        public FlatPrefetchNode() {
                hspp = new HashSet<PrefetchPair>();
+        siteid = new Integer(1);
        }
 
        public String toString() {
-               return "prefetchnode";
+           String st="prefetch(";
+           boolean first=true;
+           for(Iterator<PrefetchPair> it=hspp.iterator();it.hasNext();) {
+               PrefetchPair pp=it.next();
+               if (!first)
+                   st+=", ";
+               first=false;
+               st+=pp;
+           }
+           return st+")";
        }
 
        public int kind() {
@@ -28,4 +39,8 @@ public class FlatPrefetchNode extends FlatNode {
        public HashSet<PrefetchPair> getPrefetchPairs() {
                return hspp;
        }
+
+       public int getNumPairs() {
+               return hspp.size();
+       }
 }