org.ozoneDB.xml.dom
Class NamedNodeMapImpl

java.lang.Object
  |
  +--org.ozoneDB.OzoneObject
        |
        +--org.ozoneDB.xml.dom.NamedNodeMapImpl
All Implemented Interfaces:
java.io.Externalizable, org.w3c.dom.NamedNodeMap, NamedNodeMapProxy, org.ozoneDB.OzoneCompatible, org.ozoneDB.OzoneCompatibleOrProxy, org.ozoneDB.OzoneRemote, java.io.Serializable

public final class NamedNodeMapImpl
extends org.ozoneDB.OzoneObject
implements NamedNodeMapProxy, java.io.Externalizable

Implements a collection of nodes that can be accessed by name. Used mostly by DocumentTypeImpl to hold collections of element, notation and other definitions.

The actual collection of objects is held by some owner node in a Dictionary. This map object provides access to this dictionary in a manner that is consistent with the DOM. This map can be accessed concurrently, so the owner need only create one map per dictionary.

Nodes are not maintained in any particular order, so accessing them by index can be expected to be a slow operation.

Version:
$Revision: 1.1 $ $Date: 2001/12/18 11:03:24 $
Author:
Assaf Arkin
See Also:
NamedNodeMap, Serialized Form

Constructor Summary
NamedNodeMapImpl()
           
NamedNodeMapImpl(NodeProxy owner, java.util.Dictionary dictionary)
          Constructor required the owner of this dictionary and a reference to the dictionary.
 
Method Summary
 java.util.Enumeration elements()
          So we lied about the owner managing the dictionary.
 int getLength()
           
 org.w3c.dom.Node getNamedItem(java.lang.String name)
           
 org.w3c.dom.Node getNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
           
 void init(NodeProxy owner, java.util.Dictionary dictionary)
           
 org.w3c.dom.Node item(int index)
           
 void readExternal(java.io.ObjectInput in)
           
 org.w3c.dom.Node removeNamedItem(java.lang.String name)
           
 org.w3c.dom.Node removeNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
           
 org.w3c.dom.Node setNamedItem(org.w3c.dom.Node arg)
           
 org.w3c.dom.Node setNamedItemNS(org.w3c.dom.Node arg)
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class org.ozoneDB.OzoneObject
container, database, deleteRecursive, getObjectID, handle, hashCode, onCreate, onDelete, self, setContainer, toString, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ozoneDB.OzoneCompatibleOrProxy
getObjectID
 

Constructor Detail

NamedNodeMapImpl

public NamedNodeMapImpl(NodeProxy owner,
                        java.util.Dictionary dictionary)
Constructor required the owner of this dictionary and a reference to the dictionary. Once constructed, the map is ready for use.

Parameters:
owner - The owner of this dictionary
dictionary - The dictionary managed by that owner

NamedNodeMapImpl

public NamedNodeMapImpl()
Method Detail

getNamedItemNS

public org.w3c.dom.Node getNamedItemNS(java.lang.String namespaceURI,
                                       java.lang.String localName)
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
Specified by:
setNamedItemNS in interface org.w3c.dom.NamedNodeMap
org.w3c.dom.DOMException

removeNamedItemNS

public org.w3c.dom.Node removeNamedItemNS(java.lang.String namespaceURI,
                                          java.lang.String localName)
                                   throws org.w3c.dom.DOMException
Specified by:
removeNamedItemNS in interface org.w3c.dom.NamedNodeMap
org.w3c.dom.DOMException

getNamedItem

public org.w3c.dom.Node getNamedItem(java.lang.String name)
Specified by:
getNamedItem in interface NamedNodeMapProxy

setNamedItem

public org.w3c.dom.Node setNamedItem(org.w3c.dom.Node arg)
                              throws org.w3c.dom.DOMException
Specified by:
setNamedItem in interface org.w3c.dom.NamedNodeMap
org.w3c.dom.DOMException

removeNamedItem

public org.w3c.dom.Node removeNamedItem(java.lang.String name)
                                 throws org.w3c.dom.DOMException
Specified by:
removeNamedItem in interface org.w3c.dom.NamedNodeMap
org.w3c.dom.DOMException

item

public org.w3c.dom.Node item(int index)
Specified by:
item in interface org.w3c.dom.NamedNodeMap

getLength

public int getLength()
Specified by:
getLength in interface org.w3c.dom.NamedNodeMap

elements

public java.util.Enumeration elements()
So we lied about the owner managing the dictionary. But just in case the owner would like to traverse the dictionary list without resorting to the slower indexed method.

Specified by:
elements in interface NamedNodeMapProxy
Returns:
Enumeration of all elements in the dictionary

init

public void init(NodeProxy owner,
                 java.util.Dictionary dictionary)
Specified by:
init in interface NamedNodeMapProxy

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException


Copyright © 2002 The Ozone Database Project - www.ozone-db.org. All Rights Reserved.