Debian Codegraph @

freehep-graphicsio-swf/src/main/java/org/freehep/graphicsio/swf/SWFDictionary.java

raw symbols SCIP
1 // Copyright 2001, FreeHEP.
2 package org.freehep.graphicsio.swf;
3
4 import java.util.Enumeration;
5 import java.util.Hashtable;
6
7 /**
8 * SWF Definition Dictionary, which stores definitions being read from a stream.
9 *
10 * @author Mark Donszelmann
11 * @author Charles Loomis
12 * @version $Id: freehep-graphicsio-swf/src/main/java/org/freehep/graphicsio/swf/SWFDictionary.java db861da05344 2005/12/05 00:59:43 duns $
13 */
14 public class SWFDictionary extends Hashtable<Integer, DefinitionTag> {
15
16 public void put(int id, DefinitionTag tag) {
17 put(new Integer(id), tag);
18 }
19
20 public DefinitionTag get(int id) {
21 return (DefinitionTag) get(new Integer(id));
22 }
23
24 public void remove(int id) {
25 remove(new Integer(id));
26 }
27
28 public String toString() {
29 StringBuffer s = new StringBuffer("SWF Dictionary\n");
30 for (Enumeration<?> e = keys(); e.hasMoreElements();) {
31 Integer key = (Integer) e.nextElement();
32 s.append(" [" + key.intValue() + "] ");
33 s.append(get(key));
34 s.append("\n");
35 }
36 return s.toString();
37 }
38 }