Package org.htmlunit.xpath.xml.dtm.ref
Class DTMDefaultBaseTraversers.DescendantOrSelfTraverser
- 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
-
- Direct Known Subclasses:
DTMDefaultBaseTraversers.AllFromNodeTraverser
- Enclosing class:
- DTMDefaultBaseTraversers
private class DTMDefaultBaseTraversers.DescendantOrSelfTraverser extends DTMDefaultBaseTraversers.DescendantTraverser
Implements traversal of the Ancestor access, in reverse document order.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateDescendantOrSelfTraverser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intfirst(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.protected intgetFirstPotential(int identity)Get the first potential identity that can be returned.-
Methods inherited from class org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.DescendantTraverser
axisHasBeenProcessed, first, getSubtreeRoot, isAfterAxis, isDescendant, next, next
-
Methods inherited from class org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.IndexedDTMAxisTraverser
getNextIndexed, isIndexed
-
-
-
-
Method Detail
-
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:
getFirstPotentialin 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.
-
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:
firstin 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.
-
-