01: /* ===========================================================================
02: * $RCSfile: FlagHashtable.java,v $
03: * ===========================================================================
04: *
05: * RetroGuard -- an obfuscation package for Java classfiles.
06: *
07: * Copyright (c) 1998-2006 Mark Welsh (markw@retrologic.com)
08: *
09: * This program can be redistributed and/or modified under the terms of the
10: * Version 2 of the GNU General Public License as published by the Free
11: * Software Foundation.
12: *
13: * This program is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16: * GNU General Public License for more details.
17: *
18: */
19:
20: package COM.rl.obf.classfile;
21:
22: import java.io.*;
23: import java.util.*;
24:
25: /**
26: * Subclass of Hashtable used for storing flags while walking Code.
27: *
28: * @author Mark Welsh
29: */
30: public class FlagHashtable extends Hashtable {
31: public void updateFlag(CpInfo cpInfo, int index, boolean forNameFlag) {
32: StringCpInfoFlags flags = (StringCpInfoFlags) get(cpInfo);
33: if (flags == null) {
34: flags = new StringCpInfoFlags();
35: flags.stringIndex = index;
36: put(cpInfo, flags);
37: }
38: if (forNameFlag) {
39: flags.forNameFlag = true;
40: } else {
41: flags.otherFlag = true;
42: }
43: }
44: }
45:
46: class StringCpInfoFlags {
47: protected int stringIndex;
48: protected boolean forNameFlag;
49: protected boolean otherFlag;
50:
51: protected StringCpInfoFlags() {
52: }
53: }
|