org.apache.batik.dom
Class AbstractElement.NamedNodeHashMap

java.lang.Object
  |
  +--org.apache.batik.dom.AbstractElement.NamedNodeHashMap
All Implemented Interfaces:
NamedNodeMap, java.io.Serializable
Direct Known Subclasses:
SVGOMElement.SVGNamedNodeHashMap
Enclosing class:
AbstractElement

public class AbstractElement.NamedNodeHashMap
extends java.lang.Object
implements NamedNodeMap, java.io.Serializable

An implementation of the NamedNodeMap.

See Also:
Serialized Form

Field Summary
 java.lang.String namespaceURI
          The current namespace URI.
protected  HashTable table
          The place where the nodes in the anonymous namespace are stored.
protected  HashTable tableNS
          The place where the the nodes that use namespaces are stored.
 
Constructor Summary
AbstractElement.NamedNodeHashMap()
          Creates a new NamedNodeHashMap object.
 
Method Summary
protected  void checkNode(Node arg)
          Checks the validity of a node to add.
 int getLength()
          DOM: Implements NamedNodeMap.getLength().
 Node getNamedItem(java.lang.String name)
          DOM: Implements NamedNodeMap.getNamedItem(String).
 Node getNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
          DOM: Implements NamedNodeMap.getNamedItemNS(String,String).
 Node item(int index)
          DOM: Implements NamedNodeMap.item(int).
 Node removeNamedItem(java.lang.String name)
          DOM: Implements NamedNodeMap.removeNamedItem(String).
 Node removeNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
          DOM: Implements NamedNodeMap.removeNamedItemNS(String,String).
 Node setNamedItem(Node arg)
          DOM: Implements NamedNodeMap.setNamedItem(Node).
 Node setNamedItem(java.lang.String name, Node arg)
          Adds a node to the map.
 Node setNamedItemNS(Node arg)
          DOM: Implements NamedNodeMap.setNamedItemNS(Node).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected HashTable table
The place where the nodes in the anonymous namespace are stored.

tableNS

protected HashTable tableNS
The place where the the nodes that use namespaces are stored.

namespaceURI

public java.lang.String namespaceURI
The current namespace URI.
Constructor Detail

AbstractElement.NamedNodeHashMap

public AbstractElement.NamedNodeHashMap()
Creates a new NamedNodeHashMap object.
Method Detail

getNamedItem

public Node getNamedItem(java.lang.String name)
DOM: Implements NamedNodeMap.getNamedItem(String).
Specified by:
getNamedItem in interface NamedNodeMap
Following copied from interface: org.w3c.dom.NamedNodeMap
Parameters:
nameThe - nodeName of a node to retrieve.
Returns:
A Node (of any type) with the specified nodeName, or null if it does not identify any node in this map.

setNamedItem

public Node setNamedItem(Node arg)
                  throws DOMException
DOM: Implements NamedNodeMap.setNamedItem(Node).
Specified by:
setNamedItem in interface NamedNodeMap
Following copied from interface: org.w3c.dom.NamedNodeMap
Parameters:
argA - node to store in this map. The node will later be accessible using the value of its nodeName attribute.
Returns:
If the new Node replaces an existing node the replaced Node is returned, otherwise null is returned.
Throws:
DOMException - WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created this map.
NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
INUSE_ATTRIBUTE_ERR: Raised if arg is an Attr that is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.

removeNamedItem

public Node removeNamedItem(java.lang.String name)
                     throws DOMException
DOM: Implements NamedNodeMap.removeNamedItem(String).
Specified by:
removeNamedItem in interface NamedNodeMap
Following copied from interface: org.w3c.dom.NamedNodeMap
Parameters:
nameThe - nodeName of the node to remove.
Returns:
The node removed from this map if a node with such a name exists.
Throws:
DOMException - NOT_FOUND_ERR: Raised if there is no node named name in this map.
NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.

item

public Node item(int index)
DOM: Implements NamedNodeMap.item(int).
Specified by:
item in interface NamedNodeMap
Following copied from interface: org.w3c.dom.NamedNodeMap
Parameters:
indexIndex - into this map.
Returns:
The node at the indexth position in the map, or null if that is not a valid index.

getLength

public int getLength()
DOM: Implements NamedNodeMap.getLength().
Specified by:
getLength in interface NamedNodeMap

getNamedItemNS

public Node getNamedItemNS(java.lang.String namespaceURI,
                           java.lang.String localName)
DOM: Implements NamedNodeMap.getNamedItemNS(String,String).
Specified by:
getNamedItemNS in interface NamedNodeMap
Following copied from interface: org.w3c.dom.NamedNodeMap
Parameters:
namespaceURIThe - namespace URI of the node to retrieve.
localNameThe - local name of the node to retrieve.
Returns:
A Node (of any type) with the specified local name and namespace URI, or null if they do not identify any node in this map.

setNamedItemNS

public Node setNamedItemNS(Node arg)
                    throws DOMException
DOM: Implements NamedNodeMap.setNamedItemNS(Node).
Specified by:
setNamedItemNS in interface NamedNodeMap
Following copied from interface: org.w3c.dom.NamedNodeMap
Parameters:
argA - node to store in this map. The node will later be accessible using the value of its namespaceURI and localName attributes.
Returns:
If the new Node replaces an existing node the replaced Node is returned, otherwise null is returned.
Throws:
DOMException - WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created this map.
NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
INUSE_ATTRIBUTE_ERR: Raised if arg is an Attr that is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.

removeNamedItemNS

public Node removeNamedItemNS(java.lang.String namespaceURI,
                              java.lang.String localName)
                       throws DOMException
DOM: Implements NamedNodeMap.removeNamedItemNS(String,String).
Specified by:
removeNamedItemNS in interface NamedNodeMap
Following copied from interface: org.w3c.dom.NamedNodeMap
Parameters:
namespaceURIThe - namespace URI of the node to remove.
localNameThe - local name of the node to remove.
Returns:
The node removed from this map if a node with such a local name and namespace URI exists.
Throws:
DOMException - NOT_FOUND_ERR: Raised if there is no node with the specified namespaceURI and localName in this map.
NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.

setNamedItem

public Node setNamedItem(java.lang.String name,
                         Node arg)
                  throws DOMException
Adds a node to the map.

checkNode

protected void checkNode(Node arg)
Checks the validity of a node to add.


Copyright © 2000 Apache Software Foundation. All Rights Reserved.