00001 package edu.ksu.cis.bandera.abstraction.typeinference; 00002 00003 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00004 * Bandera, a Java(TM) analysis and transformation toolkit * 00005 * Copyright (C) 1998, 1999, 2000 Shawn Laubach (laubach@acm.org) * 00006 * All rights reserved. * 00007 * * 00008 * Modifications by Robby (robby@cis.ksu.edu) are * 00009 * Copyright (C) 2000 Robby. All rights reserved. * 00010 * * 00011 * This work was done as a project in the SAnToS Laboratory, * 00012 * Department of Computing and Information Sciences, Kansas State * 00013 * University, USA (http://www.cis.ksu.edu/santos). * 00014 * It is understood that any modification not identified as such is * 00015 * not covered by the preceding statement. * 00016 * * 00017 * This work is free software; you can redistribute it and/or * 00018 * modify it under the terms of the GNU Library General Public * 00019 * License as published by the Free Software Foundation; either * 00020 * version 2 of the License, or (at your option) any later version. * 00021 * * 00022 * This work is distributed in the hope that it will be useful, * 00023 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00024 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00025 * Library General Public License for more details. * 00026 * * 00027 * You should have received a copy of the GNU Library General Public * 00028 * License along with this toolkit; if not, write to the * 00029 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * 00030 * Boston, MA 02111-1307, USA. * 00031 * * 00032 * Java is a trademark of Sun Microsystems, Inc. * 00033 * * 00034 * To submit a bug report, send a comment, or get the latest news on * 00035 * this project and other SAnToS projects, please visit the web-site * 00036 * http://www.cis.ksu.edu/santos * 00037 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 00038 import java.util.*; 00039 import ca.mcgill.sable.soot.*; 00040 import edu.ksu.cis.bandera.abstraction.*; 00041 import edu.ksu.cis.bandera.abstraction.util.*; 00042 public class TypeTable { 00043 private RefHashTable table; 00044 /** 00045 * TypeTable constructor comment. 00046 */ 00047 public TypeTable() { 00048 super(); 00049 table = new RefHashTable(); 00050 } 00051 public Abstraction get(Object key) { 00052 return (Abstraction) table.get(key); 00053 } 00054 /** 00055 * Insert the method's description here. 00056 * Creation date: (4/3/00 3:26:49 PM) 00057 */ 00058 public Set keySet() { 00059 Set l = new HashSet(); 00060 Iterator i = table.keySet().iterator(); 00061 while (i.hasNext()) { 00062 l.add(i.next()); 00063 } 00064 return l; 00065 } 00066 public void put(Object key, Object type) { 00067 table.put(key, type); 00068 } 00069 /** 00070 * 00071 * @return int 00072 */ 00073 public int size() { 00074 return table.size(); 00075 } 00076 /** 00077 * Insert the method's description here. 00078 * Creation date: (5/19/00 10:00:21 AM) 00079 * @return java.lang.String 00080 */ 00081 public String toString() { 00082 String s = "TypeTable \n"; 00083 Iterator i = table.keySet().iterator(); 00084 while (i.hasNext()) { 00085 Object o = i.next(); 00086 s += o + "\t" + table.get(o) + "\n"; 00087 } 00088 return s; 00089 } 00090 }