Package org.htmlunit.xpath.xml.dtm.ref
Class DTMDefaultBaseTraversers.PrecedingTraverser
java.lang.Object
org.htmlunit.xpath.xml.dtm.DTMAxisTraverser
org.htmlunit.xpath.xml.dtm.ref.DTMDefaultBaseTraversers.PrecedingTraverser
- Enclosing class:
DTMDefaultBaseTraversers
Implements traversal of the Ancestor access, in reverse document order.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
isAncestor
(int contextIdent, int currentIdent) Tell if the current identity is an ancestor of the context identity.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.DTMAxisTraverser
first, first
-
Constructor Details
-
PrecedingTraverser
private PrecedingTraverser()
-
-
Method Details
-
isAncestor
protected boolean isAncestor(int contextIdent, int currentIdent) Tell if the current identity is an ancestor of the context identity. This is an expensive operation, made worse by the stateless traversal. But the preceding axis is used fairly infrequently.- Parameters:
contextIdent
- The context node of the axis traversal.currentIdent
- The node in question.- Returns:
- true if the currentIdent node is an ancestor of contextIdent.
-
next
public int next(int context, int current) Traverse to the next node after the current node.- Specified by:
next
in classDTMAxisTraverser
- 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.- Specified by:
next
in classDTMAxisTraverser
- 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:
-