org.apache.xml.dtm.ref
Class DTMDefaultBaseTraversers.DescendantOrSelfFromRootTraverser

java.lang.Object
  extended by org.apache.xml.dtm.DTMAxisTraverser
      extended by org.apache.xml.dtm.ref.DTMDefaultBaseTraversers.IndexedDTMAxisTraverser
          extended by org.apache.xml.dtm.ref.DTMDefaultBaseTraversers.DescendantTraverser
              extended by org.apache.xml.dtm.ref.DTMDefaultBaseTraversers.DescendantOrSelfFromRootTraverser
Enclosing class:
DTMDefaultBaseTraversers

private class DTMDefaultBaseTraversers.DescendantOrSelfFromRootTraverser
extends DTMDefaultBaseTraversers.DescendantTraverser

A non-xpath axis, returns all nodes that aren't namespaces or attributes, from and including the root.


Constructor Summary
private DTMDefaultBaseTraversers.DescendantOrSelfFromRootTraverser()
           
 
Method Summary
 int first(int context)
          Return the root.
 int first(int context, int expandedTypeID)
          By the nature of the stateless traversal, the context node can not be returned or the iteration will go into an infinate loop.
protected  int getFirstPotential(int identity)
          Get the first potential identity that can be returned, which is the axis root context in this case.
protected  int getSubtreeRoot(int handle)
          Get the first potential identity that can be returned.
 
Methods inherited from class org.apache.xml.dtm.ref.DTMDefaultBaseTraversers.DescendantTraverser
axisHasBeenProcessed, isAfterAxis, isDescendant, next, next
 
Methods inherited from class org.apache.xml.dtm.ref.DTMDefaultBaseTraversers.IndexedDTMAxisTraverser
getNextIndexed, isIndexed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTMDefaultBaseTraversers.DescendantOrSelfFromRootTraverser

private DTMDefaultBaseTraversers.DescendantOrSelfFromRootTraverser()
Method Detail

getFirstPotential

protected int getFirstPotential(int identity)
Get the first potential identity that can be returned, which is the axis root context in this case.

Overrides:
getFirstPotential in class DTMDefaultBaseTraversers.DescendantTraverser
Parameters:
identity - The node identity of the root context of the traversal.
Returns:
The identity argument.

getSubtreeRoot

protected int getSubtreeRoot(int handle)
Get the first potential identity that can be returned.

Overrides:
getSubtreeRoot in class DTMDefaultBaseTraversers.DescendantTraverser
Parameters:
handle - handle to the root context.
Returns:
identity of the root of the subtree.

first

public int first(int context)
Return the root.

Overrides:
first in class DTMAxisTraverser
Parameters:
context - The context node of this traversal.
Returns:
the first node in the traversal.

first

public int first(int context,
                 int expandedTypeID)
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>

Overrides:
first in class DTMDefaultBaseTraversers.DescendantTraverser
Parameters:
context - The context node of this traversal. This is the point of origin for the traversal -- its "root node" or starting point.
expandedTypeID - The expanded type ID that must match.
Returns:
the first node in the traversal.