1 19 20 25 26 package soot.jimple.toolkits.annotation.arraycheck; 27 28 class IntContainer 29 { 30 static IntContainer[] pool = new IntContainer[100]; 31 static { 32 for (int i=0; i<100; i++) 33 pool[i] = new IntContainer(i-50); 34 } 35 36 int value; 37 public IntContainer(int v) 38 { 39 this.value = v; 40 } 41 42 public static IntContainer v(int v) 43 { 44 if ((v >= -50) && (v <= 49)) 45 { 46 return pool[v+50]; 47 } 48 else 49 return new IntContainer(v); 50 } 51 52 public IntContainer dup() 53 { 54 return new IntContainer(value); 55 } 56 57 public int hashCode() 58 { 59 return value; 60 } 61 62 public boolean equals(Object other) 63 { 64 if (other instanceof IntContainer) 65 { 66 return ((IntContainer)other).value == this.value ; 67 } 68 69 return false; 70 } 71 72 public String toString() 73 { 74 return ""+value; 75 } 76 77 } 78 79 | Popular Tags |