Qt Jambi Home

com.trolltech.qt.xml
Class QDomNamedNodeMap

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

public class QDomNamedNodeMap
extends QtJambiObject

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.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Constructor Summary
QDomNamedNodeMap()
          Constructs an empty named node map.
QDomNamedNodeMap(QDomNamedNodeMap arg__1)
          Constructs a copy of arg__1.
 
Method Summary
 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 equals(java.lang.Object other)
          
static QDomNamedNodeMap fromNativePointer(QNativePointer nativePointer)
          This function returns the QDomNamedNodeMap instance pointed to by nativePointer
 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.
static QNativePointer nativePointerArray(QDomNamedNodeMap[] array)
          This function returns a QNativePointer that is pointing to the specified QDomNamedNodeMap array.
 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, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class java.lang.Object
clone, 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 arg__1.

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, 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, 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, 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, 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, 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, setNamedItem

size

public final int size()

This function is provided for Qt API consistency. It is equivalent to length.


fromNativePointer

public static QDomNamedNodeMap fromNativePointer(QNativePointer nativePointer)
This function returns the QDomNamedNodeMap instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.

nativePointerArray

public static QNativePointer nativePointerArray(QDomNamedNodeMap[] array)
This function returns a QNativePointer that is pointing to the specified QDomNamedNodeMap array.

Parameters:
array - the array that the returned pointer will point to.
Returns:
a QNativePointer that is pointing to the specified array.

equals

public boolean equals(java.lang.Object other)

Overrides:
equals in class java.lang.Object

Qt Jambi Home