📄 hashmapnamednodemap.java
字号:
/*
Copyright (C) 2003 Together
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.enhydra.xml;
import java.util.ArrayList;
import java.util.HashMap;
import org.w3c.dom.DOMException;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
/**
* @author Tweety
*
* A class representing a node in a meta-data tree, which implements
* the <a href="../../../../api/org/w3c/dom/NamedNodeMap.html">
*
* @version 1.0
*/
class HashMapNamedNodeMap extends NamedNodeMapImpl {
/**
* HashMap of <code>Node</code> items.
*/
HashMap hNodes;
/**
* Constructs a <code>HashMapNamedNodeMap</code> from the given <code>HashMap</code>.
*
* @param nodes , as a <code>HashMap</code>.
*/
public HashMapNamedNodeMap(HashMap nodes) {
super(new ArrayList(nodes.values()));
this.hNodes = nodes;
}
/**
* Returns the items count.
*
* @return items count.
*/
public int getLength() {
return hNodes.size();
}
/**
* Returns the <code>Node</code> item with the given name.
*
* @param name <code>Node</code> name.
*
* @return <code>Node</code> item with the given name.
*/
public Node getNamedItem(String name) {
return (Node) hNodes.get(name);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -