Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

StaticMap.java

00001 package gov.nasa.arc.ase.jpf.jvm;
00002 
00003 import java.util.*;
00004 
00005 public class StaticMap {
00006 // ifdef NO_STATIC_SYMMETRY
00007   static Hashtable nameMap = new Hashtable();
00008   static int numEntries = 0;
00009 
00010 //#endif NO_STATIC_SYMMETRY
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 }

Generated at Thu Feb 7 06:55:52 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001