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 classSimple 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 TypeMethodDescriptionintgetNamedItem(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:
getLengthin interfaceNamedNodeMap
-
getNamedItem
- Specified by:
getNamedItemin interfaceNamedNodeMap
-
item
- Specified by:
itemin interfaceNamedNodeMap
-
setNamedItem
- Specified by:
setNamedItemin interfaceNamedNodeMap
-
removeNamedItem
- Specified by:
removeNamedItemin interfaceNamedNodeMap
-
getNamedItemNS
- Specified by:
getNamedItemNSin interfaceNamedNodeMap
-
setNamedItemNS
- Specified by:
setNamedItemNSin interfaceNamedNodeMap- Throws:
DOMException
-
removeNamedItemNS
- Specified by:
removeNamedItemNSin interfaceNamedNodeMap- Throws:
DOMException
-