Package org.htmlunit.xpath.xml.dtm.ref
Class DTMDefaultBaseTraversers.RootTraverser
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.DescendantOrSelfTraverser
org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.AllFromNodeTraverser
org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.AllFromRootTraverser
org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.RootTraverser
- Enclosing class:
DTMDefaultBaseTraversers
private class DTMDefaultBaseTraversers.RootTraverser
extends DTMDefaultBaseTraversers.AllFromRootTraverser
Implements traversal of the Self axis.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
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.int
next
(int context, int current) Traverse to the next node after the current node.int
next
(int context, int current, int expandedTypeID) Traverse to the next node after the current node that is matched by the extended type ID.Methods inherited from class org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.AllFromRootTraverser
first
Methods inherited from class org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.DescendantOrSelfTraverser
getFirstPotential
Methods inherited from class org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.DescendantTraverser
axisHasBeenProcessed, getSubtreeRoot, isAfterAxis, isDescendant
Methods inherited from class org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.IndexedDTMAxisTraverser
getNextIndexed, isIndexed
-
Constructor Details
-
RootTraverser
private RootTraverser()
-
-
Method Details
-
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.AllFromRootTraverser
- 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.
-
next
public int next(int context, int current) Traverse to the next node after the current node.- Overrides:
next
in classDTMDefaultBaseTraversers.AllFromRootTraverser
- Parameters:
context
- The context node of this traversal. This is the point of origin for the traversal -- its "root node" or starting point.current
- 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:
- the next node in the iteration, or DTM.NULL.
- See Also:
-
next
public int next(int context, int current, int expandedTypeID) Traverse to the next node after the current node that is matched by the extended type ID.- Overrides:
next
in classDTMDefaultBaseTraversers.AllFromRootTraverser
- Parameters:
context
- The context node of this traversal. This is the point of origin for the traversal -- its "root node" or starting point.current
- 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.expandedTypeID
- The extended type ID that must match.- Returns:
- the next node in the iteration, or DTM.NULL.
- See Also:
-