class DOM_NodeList

The NodeList interface provides the abstraction of an ordered collection of nodes

Inheritance:


Public

Comparison operators.
bool operator == (const DOM_NodeList &other) const
Equality operator
bool operator != (const DOM_NodeList &other) const
Equality operator
Constructors and assignment operator
SKIP DOM_NodeList ()
Default constructor for DOM_NodeList
DOM_NodeList (const DOM_NodeList &other)
Copy constructor
DOM_NodeList& operator = (const DOM_NodeList &other)
Assignment operator
DOM_NodeList& operator = (const DOM_NullPtr *val)
Assignment operator
Destructor.
~DOM_NodeList ()
Destructor for DOM_NodeList
Get functions.
DOM_Node item (int index) const
Returns the indexth item in the collection
int getLength () const
Returns the number of nodes in the list

Documentation

The NodeList interface provides the abstraction of an ordered collection of nodes. NodeLists are created by DOM_Document::getElementsByTagName(), DOM_Node::getChildNodes(),

The items in the NodeList are accessible via an integral index, starting from 0. NodeLists are "live", in that any changes to the document tree are immediately reflected in any NodeLists that may have been created for that tree.

Constructors and assignment operator

SKIP DOM_NodeList()
Default constructor for DOM_NodeList. The resulting object does not refer to an actual NodeList; it will compare == to 0, and is similar to a null object reference variable in Java. It may subsequently be assigned to refer to an actual NodeList.

DOM_NodeList(const DOM_NodeList &other)
Copy constructor.
Parameters:
other - The object to be copied.

DOM_NodeList& operator = (const DOM_NodeList &other)
Assignment operator.
Parameters:
other - The object to be copied.

DOM_NodeList& operator = (const DOM_NullPtr *val)
Assignment operator. This overloaded variant is provided for the sole purpose of setting a DOM_Node reference variable to zero. Nulling out a reference variable in this way will decrement the reference count on the underlying Node object that the variable formerly referenced. This effect is normally obtained when reference variable goes out of scope, but zeroing them can be useful for global instances, or for local instances that will remain in scope for an extended time, when the storage belonging to the underlying node needs to be reclaimed.
Parameters:
val. - Only a value of 0, or null, is allowed.

Destructor.

~DOM_NodeList()
Destructor for DOM_NodeList. The object being destroyed is the reference object, not the underlying NodeList node itself.

Like most other DOM types in this implementation, memory management of Node Lists is automatic. Instances of DOM_NodeList function as references to an underlying heap based implementation object, and should never be explicitly new-ed or deleted in application code, but should appear only as local variables or function parameters.

Comparison operators.

bool operator == (const DOM_NodeList &other) const
Equality operator. Note that compares whether two node list variables refer to the same underlying node list. It does not compare the contents of the node lists themselves.

bool operator != (const DOM_NodeList &other) const
Equality operator. Note that compares whether two node list variables refer to the same underlying node list. It does not compare the contents of the node lists themselves.

Get functions.

DOM_Node item(int index) const
Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.
Returns:
The node at the indexth position in the NodeList, or null if that is not a valid index.
Parameters:
index - Index into the collection.

int getLength() const
Returns the number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.


This class has no child classes.

alphabetic index hierarchy of classes


XML Parser for C++ 2.0
Copyright © IBM Corp, 1999
Center for Java Technology
10275 N. De Anza Blvd.
Cupertino CA 95014 USA
Email: xml4c@us.ibm.com

IBM Logo