3 import java.util.HashSet;
4 import java.util.Iterator;
7 public class MethodSummary {
9 public static final Integer VOID=new Integer(0);
10 public static final Integer ACCESSIBLE = new Integer(1);
11 public static final Integer INACCESSIBLE=new Integer(2);
13 private int childSESECount;
14 private HashSet<PreEffectsKey> effectsSet;
15 private Integer accessibility;
16 private StallSite returnStallSite;
17 private HashSet<Integer> stallParamIdxSet;
19 public MethodSummary() {
20 effectsSet = new HashSet<PreEffectsKey>();
21 accessibility = MethodSummary.VOID;
24 stallParamIdxSet=new HashSet<Integer>();
27 public HashSet<Integer> getStallParamIdxSet(){
28 return stallParamIdxSet;
31 public void addStallParamIdxSet(Set<Integer> newSet){
33 stallParamIdxSet.addAll(newSet);
37 public void setReturnStallSite(StallSite ss){
41 public StallSite getReturnStallSite(){
42 return returnStallSite;
45 public void increaseChildSESECount() {
49 public int getChildSESECount() {
50 return childSESECount;
53 public Integer getReturnValueAccessibility() {
57 public void setReturnValueAccessibility(Integer accessibility) {
58 this.accessibility = accessibility;
61 public HashSet<PreEffectsKey> getEffectsSet() {
66 public String toString() {
67 return "MethodSummary [accessibility=" + accessibility
68 + ", childSESECount=" + childSESECount + ", effectsSet="
72 public HashSet<PreEffectsKey> getEffectsSetByParamIdx(int paramIdx){
74 HashSet<PreEffectsKey> returnSet=new HashSet<PreEffectsKey>();
76 for (Iterator iterator = effectsSet.iterator(); iterator.hasNext();) {
77 PreEffectsKey preEffectsKey = (PreEffectsKey) iterator.next();
78 if(preEffectsKey.getParamIndex().equals(new Integer(paramIdx))){
79 returnSet.add(preEffectsKey);
90 public static final Integer READ_EFFECT = new Integer(1);
91 public static final Integer WRITE_EFFECT = new Integer(2);
95 private Integer effectType;
96 private Integer paramIndex;
98 public PreEffectsKey(Integer paramIndex, String field, String type,
100 this.paramIndex = paramIndex;
103 this.effectType = effectType;
106 public String getType() {
110 public String getField() {
114 public Integer getEffectType() {
118 public Integer getParamIndex() {
122 public String toString() {
123 return "PreEffectsKey [effectType=" + effectType + ", field=" + field
124 + ", paramIndex=" + paramIndex + ", type=" + type + "]";
127 public boolean equals(Object o) {
133 if (!(o instanceof PreEffectsKey)) {
137 PreEffectsKey in = (PreEffectsKey) o;
139 this.paramIndex = paramIndex;
142 this.effectType = effectType;
144 if (paramIndex.equals(in.getParamIndex())
145 && field.equals(in.getField()) && type.equals(in.getType())
146 && effectType.equals(in.getEffectType())) {