home *** CD-ROM | disk | FTP | other *** search
- package com.ibm.xml.parser;
-
- import java.util.Enumeration;
- import java.util.Hashtable;
- import org.w3c.dom.NamedNodeMap;
- import org.w3c.dom.Node;
-
- class DTD$HashNamedNodeMap implements NamedNodeMap {
- Hashtable hash;
- Node[] data;
-
- DTD$HashNamedNodeMap(Hashtable var1) {
- this.hash = var1;
- this.makeArray();
- }
-
- public Node getNamedItem(String var1) {
- Object var2 = this.hash.get(var1);
- if (var2 == null) {
- return null;
- } else if (var2 instanceof TXNotation) {
- return ((TXNotation)var2).getNotationImpl();
- } else if (var2 instanceof EntityDecl) {
- return ((EntityDecl)var2).getEntityImpl();
- } else {
- throw new RuntimeException("XML4J internal error: non-supported hash.");
- }
- }
-
- public Node setNamedItem(Node var1) {
- throw new TXDOMException((short)7, "This NamedNodeMap is read-only.");
- }
-
- public Node removeNamedItem(String var1) {
- throw new TXDOMException((short)7, "This NamedNodeMap is read-only.");
- }
-
- public Node item(int var1) {
- return this.data[var1];
- }
-
- public int getLength() {
- return this.data.length;
- }
-
- private void makeArray() {
- this.data = new Node[this.hash.size()];
- Enumeration var1 = this.hash.elements();
-
- for(int var2 = 0; var1.hasMoreElements(); this.data[var2++] = (Node)var1.nextElement()) {
- }
-
- }
- }
-