1 package gov.nasa.jpf.jvm; 20 21 import gov.nasa.jpf.jvm.bytecode.Instruction; 22 23 24 31 public class DynamicMapIndex { 32 private Instruction pc; 33 private int threadref; 34 private int occurrence; 35 36 public DynamicMapIndex (Instruction p, int t, int o) { 37 pc = p; 38 threadref = t; 39 occurrence = o; 40 } 41 42 public Object clone () { 43 return new DynamicMapIndex(pc, threadref, occurrence); 44 } 45 46 public boolean equals (Object obj) { 47 if (obj instanceof DynamicMapIndex) { 48 DynamicMapIndex dmi = (DynamicMapIndex) obj; 49 50 return ((pc == dmi.pc) && (threadref == dmi.threadref) && 51 (occurrence == dmi.occurrence)); 52 } 53 54 return false; 55 } 56 57 public int hashCode () { 58 return (((pc == null) ? 0 : pc.getPosition()) + threadref + occurrence); 60 } 61 62 public void next () { 63 occurrence++; 64 } 65 } | Popular Tags |