com.trolltech.qt.xml
Class QDomNamedNodeMap

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.xml.QDomNamedNodeMap
All Implemented Interfaces:
QtJambiInterface, java.lang.Cloneable

public class QDomNamedNodeMap
extends QtJambiObject
implements java.lang.Cloneable

The QDomNamedNodeMap class contains a collection of nodes that can be accessed by name. Note that QDomNamedNodeMap does not inherit from QDomNodeList. QDomNamedNodeMaps do not provide any specific node ordering. Although nodes in a QDomNamedNodeMap may be accessed by an ordinal index, this is simply to allow a convenient enumeration of the contents of a QDomNamedNodeMap, and does not imply that the DOM specifies an ordering of the nodes.

The QDomNamedNodeMap is used in three places:

  1. QDomDocumentType::entities() returns a map of all entities described in the DTD.
  2. QDomDocumentType::notations() returns a map of all notations described in the DTD.
  3. QDomNode::attributes() returns a map of all attributes of an element.
Items in the map are identified by the name which QDomNode::name() returns. Nodes are retrieved using namedItem(), namedItemNS() or item(). New nodes are inserted with setNamedItem() or setNamedItemNS() and removed with removeNamedItem() or removeNamedItemNS(). Use contains() to see if an item with the given name is in the named node map. The number of items is returned by length().

Terminology: in this class we use "item" and "node" interchangeably.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
QDomNamedNodeMap()
          Constructs an empty named node map.
QDomNamedNodeMap(QDomNamedNodeMap arg__1)
          Constructs a copy of n.
 
Method Summary
 QDomNamedNodeMap clone()
          This method is reimplemented for internal reasons
 boolean contains(java.lang.String name)
          Returns true if the map contains a node called name; otherwise returns false.
 int count()
          This function is provided for Qt API consistency.
 boolean isEmpty()
          Returns true if the map is empty; otherwise returns false.
 QDomNode item(int index)
          Retrieves the node at position index.
 int length()
          Returns the number of nodes in the map.
 QDomNode namedItem(java.lang.String name)
          Returns the node called name.
 QDomNode namedItemNS(java.lang.String nsURI, java.lang.String localName)
          Returns the node associated with the local name localName and the namespace URI nsURI.
 QDomNode removeNamedItem(java.lang.String name)
          Removes the node called name from the map.
 QDomNode removeNamedItemNS(java.lang.String nsURI, java.lang.String localName)
          Removes the node with the local name localName and the namespace URI nsURI from the map.
 QDomNode setNamedItem(QDomNode newNode)
          Inserts the node newNode into the named node map.
 QDomNode setNamedItemNS(QDomNode newNode)
          Inserts the node newNode in the map.
 int size()
          This function is provided for Qt API consistency.
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QDomNamedNodeMap

public QDomNamedNodeMap()
Constructs an empty named node map.


QDomNamedNodeMap

public QDomNamedNodeMap(QDomNamedNodeMap arg__1)
Constructs a copy of n.

Method Detail

contains

public final boolean contains(java.lang.String name)
Returns true if the map contains a node called name; otherwise returns false.

Note: This function does not take the presence of namespaces into account. Use namedItemNS() to test whether the map contains a node with a specific namespace URI and name.


count

public final int count()
This function is provided for Qt API consistency. It is equivalent to length().


isEmpty

public final boolean isEmpty()
Returns true if the map is empty; otherwise returns false. This function is provided for Qt API consistency.


item

public final QDomNode item(int index)
Retrieves the node at position index.

This can be used to iterate over the map. Note that the nodes in the map are ordered arbitrarily.

See also:
length().


length

public final int length()
Returns the number of nodes in the map.

See also:
item().


namedItem

public final QDomNode namedItem(java.lang.String name)
Returns the node called name.

If the named node map does not contain such a node, a null node is returned. A node's name is the name returned by QDomNode::nodeName().

See also:
setNamedItem(), and namedItemNS().


namedItemNS

public final QDomNode namedItemNS(java.lang.String nsURI,
                                  java.lang.String localName)
Returns the node associated with the local name localName and the namespace URI nsURI.

If the map does not contain such a node, a null node is returned.

See also:
setNamedItemNS(), and namedItem().


removeNamedItem

public final QDomNode removeNamedItem(java.lang.String name)
Removes the node called name from the map.

The function returns the removed node or a null node if the map did not contain a node called name.

See also:
setNamedItem(), namedItem(), and removeNamedItemNS().


removeNamedItemNS

public final QDomNode removeNamedItemNS(java.lang.String nsURI,
                                        java.lang.String localName)
Removes the node with the local name localName and the namespace URI nsURI from the map.

The function returns the removed node or a null node if the map did not contain a node with the local name localName and the namespace URI nsURI.

See also:
setNamedItemNS(), namedItemNS(), and removeNamedItem().


setNamedItem

public final QDomNode setNamedItem(QDomNode newNode)
Inserts the node newNode into the named node map. The name used by the map is the node name of newNode as returned by QDomNode::nodeName().

If the new node replaces an existing node, i.e. the map contains a node with the same name, the replaced node is returned.

See also:
namedItem(), removeNamedItem(), and setNamedItemNS().


setNamedItemNS

public final QDomNode setNamedItemNS(QDomNode newNode)
Inserts the node newNode in the map. If a node with the same namespace URI and the same local name already exists in the map, it is replaced by newNode. If the new node replaces an existing node, the replaced node is returned.

See also:
namedItemNS(), removeNamedItemNS(), and setNamedItem().


size

public final int size()
This function is provided for Qt API consistency. It is equivalent to length().


clone

public QDomNamedNodeMap clone()
This method is reimplemented for internal reasons

Overrides:
clone in class java.lang.Object