01: /*
02: * LocalVariable.java Copyright (c) 2006,07 Swaroop Belur
03: *
04: * This program is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU General Public License
06: * as published by the Free Software Foundation; either version 2
07: * of the License, or (at your option) any later version.
08:
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13:
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17: *
18: */
19:
20: package net.sf.jdec.core;
21:
22: import java.util.Hashtable;
23:
24: public class LocalVariableTable {
25:
26: private Hashtable allLocalVaraibles = new Hashtable(); // This stores all local variables for this Class
27:
28: private static LocalVariableTable ref = null;
29:
30: private static boolean classCompiledWithDebugOption = false;
31:
32: private LocalVariableTable() {
33: classCompiledWithDebugOption = true;
34: }
35:
36: public static LocalVariableTable getInstance() {
37: if (ref == null) {
38: ref = new LocalVariableTable();
39: return ref;
40: } else
41: return ref;
42: }
43:
44: public void addEntry(String methodDesc,
45: LocalVariableStructure localvarstructure) {
46: allLocalVaraibles.put(methodDesc, localvarstructure);
47: }
48:
49: public Hashtable getAllLocalVaraibles() {
50: return allLocalVaraibles;
51: }
52:
53: public LocalVariableStructure getLocaVarStructure(String mName) {
54:
55: if (allLocalVaraibles.size() > 0) {
56: LocalVariableStructure structure = (LocalVariableStructure) allLocalVaraibles
57: .get(mName);
58: return structure;
59: }
60:
61: return null;
62: }
63:
64: }
|