1 package gov.nasa.jpf.jvm; 20 21 import gov.nasa.jpf.util.HashData; 22 23 24 30 public class AtomicData { 31 34 public MethodInfo currentMethod; 35 36 39 public int line; 40 41 45 public boolean inSameMethod; 46 47 public Object clone () { 48 AtomicData a = new AtomicData(); 49 50 a.currentMethod = currentMethod; 51 a.line = line; 52 a.inSameMethod = inSameMethod; 53 54 return a; 55 } 56 57 public boolean equals (Object o) { 58 if (o == null) { 59 return false; 60 } 61 62 if (!(o instanceof AtomicData)) { 63 return false; 64 } 65 66 AtomicData a = (AtomicData) o; 67 68 if (currentMethod != a.currentMethod) { 69 return false; 70 } 71 72 if (line != a.line) { 73 return false; 74 } 75 76 if (inSameMethod != a.inSameMethod) { 77 return false; 78 } 79 80 return true; 81 } 82 83 86 public void hash (HashData hd) { 87 hd.add(line); 88 hd.add(inSameMethod ? 1 : 0); 89 } 90 91 94 public int hashCode () { 95 HashData hd = new HashData(); 96 97 hash(hd); 98 99 return hd.getValue(); 100 } 101 } 102 | Popular Tags |