00001 package gov.nasa.arc.ase.jpf.jvm;
00002
00003 import java.util.*;
00004
00005 public class StaticMap {
00006
00007 static Hashtable nameMap = new Hashtable();
00008 static int numEntries = 0;
00009
00010
00011 public static int addEntry(String className) {
00012 if (nameMap.containsKey(className)) {
00013 return ((Integer)nameMap.get(className)).intValue();
00014 }
00015 else {
00016 nameMap.put(className,new Integer(numEntries));
00017 numEntries++;
00018 return numEntries-1;
00019 }
00020 }
00021 public static int getEntry(String className) {
00022 return ((Integer)nameMap.get(className)).intValue();
00023 }
00024 public static boolean hasEntry(String className){
00025 return nameMap.containsKey(className);
00026 }
00027 public static void reset() {
00028 nameMap = new Hashtable();
00029 numEntries = 0;
00030 }
00031 }