Package org.htmlunit.xpath.xml.dtm.ref
Class DTMDefaultBaseTraversers.DescendantFromRootTraverser
java.lang.Object
org.htmlunit.xpath.xml.dtm.DTMAxisTraverser
org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.IndexedDTMAxisTraverser
org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.DescendantTraverser
org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.DescendantFromRootTraverser
- Enclosing class:
DTMDefaultBaseTraversers
private class DTMDefaultBaseTraversers.DescendantFromRootTraverser
extends DTMDefaultBaseTraversers.DescendantTraverser
A non-xpath axis, returns all nodes that aren't namespaces or attributes, from but not
including the root.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
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.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.protected int
getSubtreeRoot
(int handle) Get the subtree root identity from the handle that was passed in by the caller.Methods inherited from class org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.DescendantTraverser
axisHasBeenProcessed, isAfterAxis, isDescendant, next, next
Methods inherited from class org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.IndexedDTMAxisTraverser
getNextIndexed, isIndexed
-
Constructor Details
-
DescendantFromRootTraverser
private DescendantFromRootTraverser()
-
-
Method Details
-
getFirstPotential
protected int getFirstPotential(int identity) Get the first potential identity that can be returned. This should be overridded by classes that need to return the self node.- Overrides:
getFirstPotential
in classDTMDefaultBaseTraversers.DescendantTraverser
- Parameters:
identity
- The node identity of the root context of the traversal.- Returns:
- The first potential node that can be in the traversal.
-
getSubtreeRoot
protected int getSubtreeRoot(int handle) Get the subtree root identity from the handle that was passed in by the caller. Derived classes may override this to change the root context of the traversal.- Overrides:
getSubtreeRoot
in classDTMDefaultBaseTraversers.DescendantTraverser
- Parameters:
handle
- handle to the root context.- Returns:
- identity of the root of the subtree.
-
first
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.
- Overrides:
first
in classDTMAxisTraverser
- Parameters:
context
- The context node of this traversal. This is the point that the traversal starts from.- 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.
- Overrides:
first
in classDTMDefaultBaseTraversers.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 extended type ID that must match.- Returns:
- the first node in the traversal.
-