Top Description Constructors Methods
com.sun.org.apache.xml.internal.dtm

public abstract Class DTMAxisTraverser

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseTraversers.AncestorTraverser, com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseTraversers.AttributeTraverser, com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseTraversers.ChildTraverser, com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseTraversers.IndexedDTMAxisTraverser, com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseTraversers.FollowingSiblingTraverser, com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseTraversers.NamespaceDeclsTraverser, com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseTraversers.NamespaceTraverser, com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseTraversers.ParentTraverser, com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseTraversers.PrecedingTraverser, com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseTraversers.PrecedingAndAncestorTraverser, com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseTraversers.PrecedingSiblingTraverser, com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBaseTraversers.SelfTraverser

A class that implements traverses DTMAxisTraverser interface can traverse a set of nodes, usually as defined by an XPath axis. It is different from an iterator, because it does not need to hold state, and, in fact, must not hold any iteration-based state. It is meant to be implemented as an inner class of a DTM, and returned by the getAxisTraverser(final int axis) function.

A DTMAxisTraverser can probably not traverse a reverse axis in document order.

Typical usage:


for(int nodeHandle=myTraverser.first(myContext);
    nodeHandle!=DTM.NULL;
    nodeHandle=myTraverser.next(myContext,nodeHandle))
{ ... processing for node indicated by nodeHandle goes here ... }
Author
Scott Boag

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the first node in the traversal.
first
(int
The context node of this traversal. This is the point that the traversal starts from.
context
)

By the nature of the stateless traversal, the context node can not be returned or the iteration will go into an infinate loop.

public int

Returns:

the first node in the traversal.
first
(int
The context node of this traversal. This is the point of origin for the traversal -- its "root node" or starting point.
context
,
int
The extended type ID that must match.
extendedTypeID
)

By the nature of the stateless traversal, the context node can not be returned or the iteration will go into an infinate loop.

public abstract int

Returns:

the next node in the iteration, or DTM.NULL.
next
(int
The context node of this traversal. This is the point of origin for the traversal -- its "root node" or starting point.
context
,
int
The current node of the traversal. This is the last known location in the traversal, typically the node-handle returned by the previous traversal step. For the first traversal step, context should be set equal to current. Note that in order to test whether context is in the set, you must use the first() method instead.
current
)

Traverse to the next node after the current node.

public abstract int

Returns:

the next node in the iteration, or DTM.NULL.
next
(int
The context node of this traversal. This is the point of origin for the traversal -- its "root node" or starting point.
context
,
int
The current node of the traversal. This is the last known location in the traversal, typically the node-handle returned by the previous traversal step. For the first traversal step, context should be set equal to current. Note that in order to test whether context is in the set, you must use the first() method instead.
current
,
int
The extended type ID that must match.
extendedTypeID
)

Traverse to the next node after the current node that is matched by the extended type ID.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DTMAxisTraverserback to summary
public DTMAxisTraverser()

Method Detail

firstback to summary
public int first(int context)

By the nature of the stateless traversal, the context node can not be returned or the iteration will go into an infinate loop. So to traverse an axis, the first function must be used to get the first node.

This method needs to be overloaded only by those axis that process the self node. <\p>

Parameters
context:int

The context node of this traversal. This is the point that the traversal starts from.

Returns:int

the first node in the traversal.

firstback to summary
public int first(int context, int extendedTypeID)

By the nature of the stateless traversal, the context node can not be returned or the iteration will go into an infinate loop. So to traverse an axis, the first function must be used to get the first node.

This method needs to be overloaded only by those axis that process the self node. <\p>

Parameters
context:int

The context node of this traversal. This is the point of origin for the traversal -- its "root node" or starting point.

extendedTypeID:int

The extended type ID that must match.

Returns:int

the first node in the traversal.

nextback to summary
public abstract int next(int context, int current)

Traverse to the next node after the current node.

Parameters
context:int

The context node of this traversal. This is the point of origin for the traversal -- its "root node" or starting point.

current:int

The current node of the traversal. This is the last known location in the traversal, typically the node-handle returned by the previous traversal step. For the first traversal step, context should be set equal to current. Note that in order to test whether context is in the set, you must use the first() method instead.

Returns:int

the next node in the iteration, or DTM.NULL.

See Also
first(int)
nextback to summary
public abstract int next(int context, int current, int extendedTypeID)

Traverse to the next node after the current node that is matched by the extended type ID.

Parameters
context:int

The context node of this traversal. This is the point of origin for the traversal -- its "root node" or starting point.

current:int

The current node of the traversal. This is the last known location in the traversal, typically the node-handle returned by the previous traversal step. For the first traversal step, context should be set equal to current. Note that in order to test whether context is in the set, you must use the first() method instead.

extendedTypeID:int

The extended type ID that must match.

Returns:int

the next node in the iteration, or DTM.NULL.

See Also
first(int, int)