Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.xalan.xpath.dtm
Class DTMProxyMap  view DTMProxyMap download DTMProxyMap.java

java.lang.Object
  extended byorg.apache.xalan.xpath.dtm.DTMProxyMap
All Implemented Interfaces:
org.w3c.dom.NamedNodeMap

public class DTMProxyMap
extends java.lang.Object
implements org.w3c.dom.NamedNodeMap

DTMProxyMap 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.


Field Summary
(package private)  DTM dtm
           
(package private)  int element
           
(package private)  short m_count
           
 
Constructor Summary
(package private) DTMProxyMap(DTM dtm, int element)
          Create a getAttributes NamedNodeMap for a given DTM element node
 
Method Summary
 int getLength()
          Return the number of Attributes on this Element
 org.w3c.dom.Node getNamedItem(java.lang.String name)
          Return the Attr node having a specific name
 org.w3c.dom.Node getNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
          Retrieve a node specified by local name and namespace URI -- DOMLevel 2
 org.w3c.dom.Node item(int i)
          Return the i'th Attr node bound to this element
 org.w3c.dom.Node removeNamedItem(java.lang.String name)
          DOM API requires this, but DTM is a read-only model
 org.w3c.dom.Node removeNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
          DOM 2 API requires this, but DTM is a read-only model
 org.w3c.dom.Node setNamedItem(org.w3c.dom.Node newNode)
          DOM API requires this, but DTM is a read-only model
 org.w3c.dom.Node setNamedItemNS(org.w3c.dom.Node arg)
          DOM 2 API requires this, but DTM is a read-only model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dtm

DTM dtm

element

int element

m_count

short m_count
Constructor Detail

DTMProxyMap

DTMProxyMap(DTM dtm,
            int element)
Create a getAttributes NamedNodeMap for a given DTM element node

Method Detail

getLength

public int getLength()
Return the number of Attributes on this Element

Specified by:
getLength in interface org.w3c.dom.NamedNodeMap

getNamedItem

public org.w3c.dom.Node getNamedItem(java.lang.String name)
Return the Attr node having a specific name

Specified by:
getNamedItem in interface org.w3c.dom.NamedNodeMap

item

public org.w3c.dom.Node item(int i)
Return the i'th Attr node bound to this element

Specified by:
item in interface org.w3c.dom.NamedNodeMap

setNamedItem

public org.w3c.dom.Node setNamedItem(org.w3c.dom.Node newNode)
DOM API requires this, but DTM is a read-only model

Specified by:
setNamedItem in interface org.w3c.dom.NamedNodeMap

removeNamedItem

public org.w3c.dom.Node removeNamedItem(java.lang.String name)
DOM API requires this, but DTM is a read-only model

Specified by:
removeNamedItem in interface org.w3c.dom.NamedNodeMap

getNamedItemNS

public org.w3c.dom.Node getNamedItemNS(java.lang.String namespaceURI,
                                       java.lang.String localName)
Retrieve a node specified by local name and namespace URI -- DOMLevel 2

Specified by:
getNamedItemNS in interface org.w3c.dom.NamedNodeMap

setNamedItemNS

public org.w3c.dom.Node setNamedItemNS(org.w3c.dom.Node arg)
                                throws org.w3c.dom.DOMException
DOM 2 API requires this, but DTM is a read-only model

Specified by:
setNamedItemNS in interface org.w3c.dom.NamedNodeMap

removeNamedItemNS

public org.w3c.dom.Node removeNamedItemNS(java.lang.String namespaceURI,
                                          java.lang.String localName)
                                   throws org.w3c.dom.DOMException
DOM 2 API requires this, but DTM is a read-only model

Specified by:
removeNamedItemNS in interface org.w3c.dom.NamedNodeMap