http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Installation
Build

API Docs
Samples
Programming
Migration
FAQs

Releases
Feedback
Bug-Todo

Download
CVS Repository
Mail Archive

API Docs for SAX and DOM
 

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

DOM_NodeList Class Reference

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

#include <DOM_NodeList.hpp>

List of all members.

Public Methods

Constructors and assignment operator
 DOM_NodeList ()
 Default constructor for DOM_NodeList. More...

 DOM_NodeList (const DOM_NodeList &other)
 Copy constructor. More...

DOM_NodeList& operator= (const DOM_NodeList &other)
 Assignment operator. More...

DOM_NodeList& operator= (const DOM_NullPtr *val)
 Assignment operator. More...

Destructor.
 ~DOM_NodeList ()
 Destructor for DOM_NodeList. More...

Comparison operators.
bool operator== (const DOM_NodeList &other) const
 Equality operator. More...

bool operator== (const DOM_NullPtr *nullPtr) const
 Use this comparison operator to test whether a Node List reference is null. More...

bool operator!= (const DOM_NodeList &other) const
 Inequality operator. More...

bool operator!= (const DOM_NullPtr *nullPtr) const
 Use this comparison operator to test whether a Node List reference is not null. More...

Get functions.
DOM_Node item (unsigned int index) const
 Returns the indexth item in the collection. More...

unsigned int getLength () const
 Returns the number of nodes in the list. More...


Protected Methods

 DOM_NodeList (NodeListImpl *impl)

Friends

class  DOM_Document
class  DOM_Element
class  DOM_Node
class  DOM_Entity


Detailed Description

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.


Constructor & Destructor Documentation

DOM_NodeList::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::DOM_NodeList ( const DOM_NodeList & other )
 

Copy constructor.

Parameters:
other   The object to be copied.

DOM_NodeList::~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.

DOM_NodeList::DOM_NodeList ( NodeListImpl * impl ) [protected]
 


Member Function Documentation

unsigned int DOM_NodeList::getLength ( ) const
 

Returns the number of nodes in the list.

The range of valid child node indices is 0 to length-1 inclusive.

DOM_Node DOM_NodeList::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.

Parameters:
index   Index into the collection.
Returns:
The node at the indexth position in the NodeList, or null if that is not a valid index.

bool DOM_NodeList::operator!= ( const DOM_NullPtr * nullPtr ) const
 

Use this comparison operator to test whether a Node List reference is not null.

Parameters:
nullPtr   The value to be compared, which must be 0 or null.
Returns:
Returns true if node list reference is not null

bool DOM_NodeList::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.

Parameters:
other   The value to be compared
Returns:
Returns true if node list refers to a different underlying node list

DOM_NodeList & 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.

DOM_NodeList & DOM_NodeList::operator= ( const DOM_NodeList & other )
 

Assignment operator.

Parameters:
other   The object to be copied.

bool DOM_NodeList::operator== ( const DOM_NullPtr * nullPtr ) const
 

Use this comparison operator to test whether a Node List reference is null.

Parameters:
nullPtr   The value to be compared, which must be 0 or null.
Returns:
Returns true if node list reference is null

bool DOM_NodeList::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.

Parameters:
other   The value to be compared
Returns:
Returns true if node list refers to same underlying node list


Friends And Related Function Documentation

class DOM_Document [friend]
 

class DOM_Element [friend]
 

class DOM_Entity [friend]
 

class DOM_Node [friend]
 


The documentation for this class was generated from the following file:


Copyright © 2000 The Apache Software Foundation. All Rights Reserved.