1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.jdo.impl.enhancer.classfile;
19
20 import java.util.Hashtable;
21
22 /***
23 * Environment in which to decode the attributes of a CodeAttribute.
24 */
25 class CodeEnv {
26
27 private ConstantPool constantPool;
28
29
30 private Hashtable targets = new Hashtable(7);
31
32 CodeEnv(ConstantPool constantPool) {
33 this.constantPool = constantPool;
34 }
35
36 final InsnTarget getTarget(int offset) {
37 Integer off = new Integer(offset);
38 InsnTarget targ = (InsnTarget)targets.get(off);
39 if (targ == null) {
40 targ = new InsnTarget(offset);
41 targets.put(off, targ);
42 }
43 return targ;
44 }
45
46 final InsnTarget findTarget(int offset) {
47 Integer off = new Integer(offset);
48 return (InsnTarget)targets.get(off);
49 }
50
51 final ConstantPool pool() {
52 return constantPool;
53 }
54 }