01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: package de.uka.ilkd.key.logic;
09:
10: import java.util.HashMap;
11: import java.util.Iterator;
12:
13: import de.uka.ilkd.key.java.SourceElement;
14:
15: public abstract class RenamingTable {
16:
17: public abstract SourceElement getRenaming(SourceElement se);
18:
19: public abstract Iterator getRenamingIterator();
20:
21: public static RenamingTable getRenamingTable(HashMap hmap) {
22: if (hmap.size() == 0)
23: return null;
24: if (hmap.size() == 1) {
25: Object[] oldVar = hmap.keySet().toArray();
26: Object newVar = hmap.get(oldVar[0]);
27: return new SingleRenamingTable((SourceElement) oldVar[0],
28: (SourceElement) newVar);
29: } else
30: return new MultiRenamingTable(hmap);
31: }
32:
33: public abstract HashMap getHashMap();
34:
35: }
|