Package org.htmlunit.xpath.xml.dtm.ref
Class DTMNamedNodeMap
java.lang.Object
org.htmlunit.xpath.xml.dtm.ref.DTMNamedNodeMap
- All Implemented Interfaces:
NamedNodeMap
DTMNamedNodeMap is a quickie (as opposed to quick) implementation of the DOM's NamedNodeMap
interface, intended to support DTMProxy's getAttributes() call.
***** Note: this does _not_ current attempt to cache any of the data; if you ask for attribute 27 and then 28, you'll have to rescan the first 27. It should probably at least keep track of the last one retrieved, and possibly buffer the whole array.
***** Also note that there's no fastpath for the by-name query; we search linearly until we find it or fail to find it. Again, that could be optimized at some cost in object creation/storage.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Simple implementation of DOMException. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDTMNamedNodeMap
(DTM dtm, int element) Create a getAttributes NamedNodeMap for a given DTM element node -
Method Summary
Modifier and TypeMethodDescriptionint
getNamedItem
(String name) getNamedItemNS
(String namespaceURI, String localName) item
(int i) removeNamedItem
(String name) removeNamedItemNS
(String namespaceURI, String localName) setNamedItem
(Node newNode) setNamedItemNS
(Node arg)
-
Field Details
-
dtm
The DTM for this node. -
element
final int elementThe DTM element handle. -
m_count
short m_countThe number of nodes in this map.
-
-
Constructor Details
-
DTMNamedNodeMap
Create a getAttributes NamedNodeMap for a given DTM element node- Parameters:
dtm
- The DTM Reference, must be non-null.element
- The DTM element handle.
-
-
Method Details
-
getLength
public int getLength()- Specified by:
getLength
in interfaceNamedNodeMap
-
getNamedItem
- Specified by:
getNamedItem
in interfaceNamedNodeMap
-
item
- Specified by:
item
in interfaceNamedNodeMap
-
setNamedItem
- Specified by:
setNamedItem
in interfaceNamedNodeMap
-
removeNamedItem
- Specified by:
removeNamedItem
in interfaceNamedNodeMap
-
getNamedItemNS
- Specified by:
getNamedItemNS
in interfaceNamedNodeMap
-
setNamedItemNS
- Specified by:
setNamedItemNS
in interfaceNamedNodeMap
- Throws:
DOMException
-
removeNamedItemNS
- Specified by:
removeNamedItemNS
in interfaceNamedNodeMap
- Throws:
DOMException
-