Package org.htmlunit.xpath.axes
Class ReverseAxesWalker
- java.lang.Object
-
- org.htmlunit.xpath.Expression
-
- org.htmlunit.xpath.patterns.NodeTest
-
- org.htmlunit.xpath.axes.PredicatedNodeTest
-
- org.htmlunit.xpath.axes.AxesWalker
-
- org.htmlunit.xpath.axes.ReverseAxesWalker
-
- All Implemented Interfaces:
java.lang.Cloneable
,javax.xml.transform.SourceLocator
,PathComponent
,SubContextList
,ExpressionNode
,XPathVisitable
public class ReverseAxesWalker extends AxesWalker
Walker for a reverse axes.- See Also:
- XPath 2.4 Predicates
-
-
Field Summary
Fields Modifier and Type Field Description protected DTMAxisIterator
m_iterator
The DTM inner traversal class, that corresponds to the super axis.-
Fields inherited from class org.htmlunit.xpath.axes.AxesWalker
m_axis, m_isFresh, m_nextWalker, m_prevWalker, m_root, m_traverser
-
Fields inherited from class org.htmlunit.xpath.axes.PredicatedNodeTest
DEBUG_PREDICATECOUNTING, m_foundLast, m_lpi, m_predCount, m_predicateIndex, m_proximityPositions
-
Fields inherited from class org.htmlunit.xpath.patterns.NodeTest
m_name, m_whatToShow, SCORE_NODETEST, SCORE_NONE, SCORE_NSWILD, SCORE_OTHER, SCORE_QNAME, SHOW_BYFUNCTION, WILD
-
-
Constructor Summary
Constructors Constructor Description ReverseAxesWalker(LocPathIterator locPathIterator, int axis)
Construct an AxesWalker using a LocPathIterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
countProximityPosition(int i)
Count forward one proximity position.void
detach()
Detaches the walker from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.int
getLastPos(XPathContext xctxt)
Get the number of nodes in the node list, which, in the XSLT 1 based counting system, is the last index position.protected int
getNextNode()
Get the next node in document order on the axes.protected int
getProximityPosition(int predicateIndex)
Get the current sub-context position.boolean
isReverseAxes()
Tells if this is a reverse axes.void
setRoot(int root)
Set the root node of the TreeWalker.-
Methods inherited from class org.htmlunit.xpath.axes.AxesWalker
callVisitors, clone, cloneDeep, deepEquals, findClone, getAnalysisBits, getAxis, getDTM, getNextWalker, getRoot, init, nextNode, setNextWalker, setPrevWalker, wi
-
Methods inherited from class org.htmlunit.xpath.axes.PredicatedNodeTest
acceptNode, callPredicateVisitors, canTraverseOutsideSubtree, executePredicates, getPredicate, getPredicateCount, getProximityPosition, getProximityPosition, initPredicateInfo, initProximityPosition, nodeToString, resetProximityPositions, setLocPathIterator, setPredicateCount
-
Methods inherited from class org.htmlunit.xpath.patterns.NodeTest
calcScore, execute, execute, execute, getLocalName, getNamespace, getNodeTypeTest, getStaticScore, getWhatToShow, initNodeTest, initNodeTest, setLocalName, setNamespace, setStaticScore, setWhatToShow
-
Methods inherited from class org.htmlunit.xpath.Expression
asIterator, asNode, assertion, bool, error, execute, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isSameClass, isStableNumber, num
-
-
-
-
Field Detail
-
m_iterator
protected DTMAxisIterator m_iterator
The DTM inner traversal class, that corresponds to the super axis.
-
-
Constructor Detail
-
ReverseAxesWalker
ReverseAxesWalker(LocPathIterator locPathIterator, int axis)
Construct an AxesWalker using a LocPathIterator.- Parameters:
locPathIterator
- The location path iterator that 'owns' this walker.
-
-
Method Detail
-
setRoot
public void setRoot(int root)
Set the root node of the TreeWalker. (Not part of the DOM2 TreeWalker interface).- Overrides:
setRoot
in classAxesWalker
- Parameters:
root
- The context node of this step.
-
detach
public void detach()
Detaches the walker from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.- Overrides:
detach
in classAxesWalker
-
getNextNode
protected int getNextNode()
Get the next node in document order on the axes.- Overrides:
getNextNode
in classAxesWalker
- Returns:
- the next node in document order on the axes, or null.
-
isReverseAxes
public boolean isReverseAxes()
Tells if this is a reverse axes.- Overrides:
isReverseAxes
in classPredicatedNodeTest
- Returns:
- false, unless a derived class overrides.
-
getProximityPosition
protected int getProximityPosition(int predicateIndex)
Get the current sub-context position.- Overrides:
getProximityPosition
in classPredicatedNodeTest
- Parameters:
predicateIndex
- The index of the predicate where the proximity should be taken from.- Returns:
- The node position of this walker in the sub-context node list.
-
countProximityPosition
protected void countProximityPosition(int i)
Count forward one proximity position.- Overrides:
countProximityPosition
in classPredicatedNodeTest
- Parameters:
i
- The index into the m_proximityPositions array, where the increment will occur.
-
getLastPos
public int getLastPos(XPathContext xctxt)
Get the number of nodes in the node list, which, in the XSLT 1 based counting system, is the last index position.- Specified by:
getLastPos
in interfaceSubContextList
- Overrides:
getLastPos
in classAxesWalker
- Parameters:
xctxt
- The XPath runtime context.- Returns:
- the number of nodes in the node list.
-
-