00001 package gov.nasa.arc.ase.jpf.jvm;
00002
00003 import java.util.Hashtable;
00004
00005 class DynamicMap {
00006
00007 static Hashtable Map = new Hashtable();
00008 static int numEntries = 0;
00009
00010
00011 public static int addEntry(DynamicMapIndex index) {
00012 if (Map.containsKey(index)) {
00013 return ((Integer)Map.get(index)).intValue();
00014 } else {
00015 Map.put(index.clone(), new Integer(numEntries));
00016 numEntries++;
00017 return numEntries-1;
00018 }
00019 }
00020 public static int getEntry(DynamicMapIndex index) {
00021 return ((Integer)Map.get(index)).intValue();
00022 }
00023 public static boolean hasEntry(DynamicMapIndex index) {
00024 return Map.containsKey(index);
00025 }
00026 }