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