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_NullPtr *nullPtr) const
Use this comparison operator to test whether a Node List reference is null
bool operator != (const DOM_NodeList &other) const
Inequality operator
bool operator != (const DOM_NullPtr *nullPtr) const
Use this comparison operator to test whether a Node List reference is not null
Constructors and assignment operator
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 (unsigned int index) const
Returns the indexth item in the collection
unsigned 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

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. Compares whether two node list variables refer to the same underlying node list. It does not compare the contents of the node lists themselves.
Returns:
Returns true if node list refers to same underlying node list
Parameters:
other - The value to be compared

bool operator == (const DOM_NullPtr *nullPtr) const
Use this comparison operator to test whether a Node List reference is null.
Returns:
Returns true if node list reference is null
Parameters:
nullPtr - The value to be compared, which must be 0 or null.

bool operator != (const DOM_NodeList &other) const
Inequality operator. Compares whether two node list variables refer to the same underlying node list. It does not compare the contents of the node lists themselves.
Returns:
Returns true if node list refers to a different underlying node list
Parameters:
other - The value to be compared

bool operator != (const DOM_NullPtr *nullPtr) const
Use this comparison operator to test whether a Node List reference is not null.
Returns:
Returns true if node list reference is not null
Parameters:
nullPtr - The value to be compared, which must be 0 or null.

Get functions.

DOM_Node item(unsigned 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.

unsigned 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


Xerces-C XML Parser for C++ Version 1.1
Copyright © 2000 The Apache Software Foundation. All Rights Reserved.

generated by doc++