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 DTMAxisIteratorm_iteratorThe 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 voidcountProximityPosition(int i)Count forward one proximity position.voiddetach()Detaches the walker from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.intgetLastPos(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 intgetNextNode()Get the next node in document order on the axes.protected intgetProximityPosition(int predicateIndex)Get the current sub-context position.booleanisReverseAxes()Tells if this is a reverse axes.voidsetRoot(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:
setRootin 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:
detachin classAxesWalker
-
getNextNode
protected int getNextNode()
Get the next node in document order on the axes.- Overrides:
getNextNodein 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:
isReverseAxesin classPredicatedNodeTest- Returns:
- false, unless a derived class overrides.
-
getProximityPosition
protected int getProximityPosition(int predicateIndex)
Get the current sub-context position.- Overrides:
getProximityPositionin 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:
countProximityPositionin 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:
getLastPosin interfaceSubContextList- Overrides:
getLastPosin classAxesWalker- Parameters:
xctxt- The XPath runtime context.- Returns:
- the number of nodes in the node list.
-
-