From: adash Date: Thu, 18 Oct 2007 18:55:15 +0000 (+0000) Subject: Added methods equals() and hashCode() to prefetchpair X-Git-Tag: preEdgeChange~410 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=48965b10e766e50e3b7fe49f4c5b9fbc1af1d9e9;p=IRC.git Added methods equals() and hashCode() to prefetchpair --- diff --git a/Robust/src/Analysis/Prefetch/PrefetchPair.java b/Robust/src/Analysis/Prefetch/PrefetchPair.java index 1c23f82f..707a44bd 100644 --- a/Robust/src/Analysis/Prefetch/PrefetchPair.java +++ b/Robust/src/Analysis/Prefetch/PrefetchPair.java @@ -5,23 +5,57 @@ import IR.*; public class PrefetchPair { TempDescriptor td; - FieldDescriptor fd; - public float num; + FieldDescriptor[] fd; + int arryindex; public PrefetchPair() { } - public PrefetchPair(TempDescriptor td, float prob) { + public PrefetchPair(TempDescriptor td) { this.td = td; - num = prob; + } + + public PrefetchPair(TempDescriptor td, int index) { + this.td = td; + fd = new FieldDescriptor[index]; + arryindex = index; } public TempDescriptor getTemp() { return td; } + public FieldDescriptor getField(int index) { + return fd[index]; + } + + public int getIndex() { + return arryindex; + } + + public int hashCode() { + int hashcode = td.hashCode(); + for(int i=0; i"; } + + public boolean equals(Object o) { + if(o instanceof PrefetchPair) { + PrefetchPair pp = (PrefetchPair) o; + if(td != pp.td) + return false; + for(int i=0; i< arryindex; i++) { + if(!fd[i].equals(pp.fd[i])) + return false; + } + } + return false; + } }