start of new file
[IRC.git] / Robust / src / IR / Flat / FlatPrefetchNode.java
index 7a8914c058849401184b47bf93c05330ee15d85e..4baaf6adfa4a288eb2f0198e95b858e61717ed7a 100644 (file)
@@ -3,14 +3,25 @@ import Analysis.Prefetch.*;
 import java.util.*;
 
 public class FlatPrefetchNode extends FlatNode {
-       HashSet<PrefetchPair> pp;
+    public Integer siteid;
+       HashSet<PrefetchPair> hspp;
 
        public FlatPrefetchNode() {
-               pp = new HashSet<PrefetchPair>();
+               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() {
@@ -18,14 +29,18 @@ public class FlatPrefetchNode extends FlatNode {
        }
 
        public void insPrefetchPair(PrefetchPair pp) {
-               this.pp.add(pp);
+               hspp.add(pp);
        }
 
        public void insAllpp(HashSet<PrefetchPair> hspp) {
-               this.pp.addAll(hspp);
+               this.hspp.addAll(hspp);
        }
 
        public HashSet<PrefetchPair> getPrefetchPairs() {
-               return this.pp;
+               return hspp;
+       }
+
+       public int getNumPairs() {
+               return hspp.size();
        }
 }