1 19 20 25 26 package soot.jimple.toolkits.annotation.arraycheck; 27 28 import soot.*; 29 import soot.jimple.*; 30 31 class MethodParameter 32 { 33 private SootMethod m; 34 private int param; 35 36 public MethodParameter(SootMethod m, int i) 37 { 38 this.m = m; 39 this.param = i; 40 } 41 42 public Type getType() 43 { 44 return m.getParameterType(param); 45 } 46 47 public int hashCode() 48 { 49 return m.hashCode()+param; 50 } 51 52 public SootMethod getMethod() 53 { 54 return m; 55 } 56 57 public int getIndex() 58 { 59 return param; 60 } 61 62 public boolean equals(Object other) 63 { 64 if (other instanceof MethodParameter) 65 { 66 MethodParameter another = (MethodParameter)other; 67 68 return (m.equals(another.getMethod()) && param == another.getIndex()); 69 } 70 71 return false; 72 } 73 74 public String toString() 75 { 76 return "["+m.getSignature()+" : P"+param+"]"; 77 } 78 } 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | Popular Tags |