View Javadoc
1 /* 2 * @(#)HashMapNode.java 1.36 02/03/21 3 * 4 * Copyright 2002 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 package org.enhydra.xml; 8 9 import java.util.ArrayList; 10 import java.util.HashMap; 11 12 import org.w3c.dom.DOMException; 13 import org.w3c.dom.NamedNodeMap; 14 import org.w3c.dom.Node; 15 16 17 18 /*** 19 * @author Tweety 20 * 21 * A class representing a node in a meta-data tree, which implements 22 * the <a href="../../../../api/org/w3c/dom/NamedNodeMap.html"> 23 * 24 * @version 1.0 25 */ 26 class HashMapNamedNodeMap extends NamedNodeMapImpl { 27 28 29 /*** 30 * HashMap of <code>Node</code> items. 31 */ 32 HashMap hNodes; 33 34 35 /*** 36 * Constructs a <code>HashMapNamedNodeMap</code> from the given <code>HashMap</code>. 37 * 38 * @param nodes, as a <code>HashMap</code>. 39 */ 40 public HashMapNamedNodeMap(HashMap nodes) { 41 super(new ArrayList(nodes.values())); 42 this.hNodes = nodes; 43 } 44 45 46 /*** 47 * Returns the items count. 48 * 49 * @return items count. 50 */ 51 public int getLength() { 52 return hNodes.size(); 53 } 54 55 56 /*** 57 * Returns the <code>Node</code> item with the given name. 58 * 59 * @param name <code>Node</code> name. 60 * 61 * @return <code>Node</code> item with the given name. 62 */ 63 public Node getNamedItem(String name) { 64 return (Node) hNodes.get(name); 65 } 66 67 }

This page automatically generated by Maven