|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xpath.Expression org.apache.xpath.patterns.NodeTest org.apache.xpath.axes.PredicatedNodeTest org.apache.xpath.axes.AxesWalker
public class AxesWalker
Serves as common interface for axes Walkers, and stores common state variables.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.xpath.axes.PredicatedNodeTest |
---|
PredicatedNodeTest.PredOwner |
Field Summary | |
---|---|
protected int |
m_axis
The traversal axis from where the nodes will be filtered. |
private int |
m_currentNode
The node at which the TreeWalker is currently positioned. |
private DTM |
m_dtm
The DTM for the root. |
(package private) boolean |
m_isFresh
True if an itteration has not begun. |
protected AxesWalker |
m_nextWalker
The next walker in the location step chain. |
(package private) AxesWalker |
m_prevWalker
The previous walker in the location step chain, or null. |
(package private) int |
m_root
The root node of the TreeWalker, as specified when it was created. |
protected DTMAxisTraverser |
m_traverser
The DTM inner traversal class, that corresponds to the super axis. |
(package private) static long |
serialVersionUID
|
Fields inherited from class org.apache.xpath.axes.PredicatedNodeTest |
---|
DEBUG_PREDICATECOUNTING, m_foundLast, m_lpi, m_predCount, m_predicateIndex, m_proximityPositions |
Fields inherited from class org.apache.xpath.patterns.NodeTest |
---|
m_name, m_whatToShow, SCORE_NODETEST, SCORE_NONE, SCORE_NSWILD, SCORE_OTHER, SCORE_QNAME, SHOW_BYFUNCTION, SUPPORTS_PRE_STRIPPING, WILD |
Constructor Summary | |
---|---|
AxesWalker(LocPathIterator locPathIterator,
int axis)
Construct an AxesWalker using a LocPathIterator. |
Method Summary | |
---|---|
void |
callVisitors(ExpressionOwner owner,
XPathVisitor visitor)
This will traverse the heararchy, calling the visitor for each member. |
java.lang.Object |
clone()
Get a cloned AxesWalker. |
(package private) AxesWalker |
cloneDeep(WalkingIterator cloneOwner,
java.util.Vector cloneList)
Do a deep clone of this walker, including next and previous walkers. |
boolean |
deepEquals(Expression expr)
Compare this object with another object and see if they are equal, include the sub heararchy. |
void |
detach()
Detaches the walker from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state. |
(package private) static AxesWalker |
findClone(AxesWalker key,
java.util.Vector cloneList)
Find a clone that corresponds to the key argument. |
int |
getAnalysisBits()
Get the analysis bits for this walker, as defined in the WalkerFactory. |
int |
getAxis()
Returns the axis being iterated, if it is known. |
int |
getCurrentNode()
The node at which the TreeWalker is currently positioned. |
DTM |
getDTM(int node)
Get the DTM for this walker. |
Expression |
getExpression()
Get the raw Expression object that this class wraps. |
int |
getLastPos(XPathContext xctxt)
Get the index of the last node that can be itterated to. |
protected int |
getNextNode()
Get the next node in document order on the axes. |
AxesWalker |
getNextWalker()
Get the next walker in the location step chain. |
AxesWalker |
getPrevWalker()
Get the previous walker reference in the location step chain. |
int |
getRoot()
The root node of the TreeWalker, as specified in setRoot(int root). |
void |
init(Compiler compiler,
int opPos,
int stepType)
Initialize an AxesWalker during the parse of the XPath expression. |
boolean |
isDocOrdered()
Returns true if all the nodes in the iteration well be returned in document order. |
int |
nextNode()
Moves the TreeWalker to the next visible node in document
order relative to the current node, and returns the new node. |
private int |
returnNextNode(int n)
This is simply a way to bottle-neck the return of the next node, for diagnostic purposes. |
void |
setDefaultDTM(DTM dtm)
Set the DTM for this walker. |
void |
setExpression(Expression exp)
Set the raw expression object for this object. |
void |
setNextWalker(AxesWalker walker)
Set the next walker in the location step chain. |
void |
setPrevWalker(AxesWalker walker)
Set or clear the previous walker reference in the location step chain. |
void |
setRoot(int root)
Set the root node of the TreeWalker. |
WalkingIterator |
wi()
|
Methods inherited from class org.apache.xpath.patterns.NodeTest |
---|
calcScore, debugWhatToShow, execute, execute, execute, getDefaultScore, getLocalName, getNamespace, getNodeTypeTest, getStaticScore, getWhatToShow, initNodeTest, initNodeTest, setLocalName, setNamespace, setStaticScore, setWhatToShow |
Methods inherited from class org.apache.xpath.Expression |
---|
asIterator, asIteratorRaw, asNode, assertion, bool, error, execute, executeCharsToContentHandler, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isNodesetExpr, isSameClass, isStableNumber, num, warn, xstr |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final long serialVersionUID
private DTM m_dtm
transient int m_root
private transient int m_currentNode
transient boolean m_isFresh
protected AxesWalker m_nextWalker
AxesWalker m_prevWalker
protected int m_axis
protected DTMAxisTraverser m_traverser
Constructor Detail |
---|
public AxesWalker(LocPathIterator locPathIterator, int axis)
locPathIterator
- non-null reference to the parent iterator.Method Detail |
---|
public final WalkingIterator wi()
public void init(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException
compiler
- The Compiler object that has information about this
walker in the op map.opPos
- The op code position of this location step.stepType
- The type of location step.
javax.xml.transform.TransformerException
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class PredicatedNodeTest
java.lang.CloneNotSupportedException
AxesWalker cloneDeep(WalkingIterator cloneOwner, java.util.Vector cloneList) throws java.lang.CloneNotSupportedException
cloneOwner
- non-null reference to the cloned location path
iterator to which this clone will be added.cloneList
- non-null vector of sources in odd elements, and the
corresponding clones in even vectors.
java.lang.CloneNotSupportedException
static AxesWalker findClone(AxesWalker key, java.util.Vector cloneList)
key
- The original AxesWalker for which there may be a clone.cloneList
- vector of sources in odd elements, and the
corresponding clones in even vectors, may be null.
public void detach()
public int getRoot()
public int getAnalysisBits()
getAnalysisBits
in interface PathComponent
public void setRoot(int root)
root
- The context node of this step.public final int getCurrentNode()
public void setNextWalker(AxesWalker walker)
walker
- Reference to AxesWalker derivative, or may be null.public AxesWalker getNextWalker()
public void setPrevWalker(AxesWalker walker)
walker
- Reference to previous walker reference in the location
step chain, or null.public AxesWalker getPrevWalker()
private int returnNextNode(int n)
n
- Node to return, or null.
protected int getNextNode()
public int nextNode()
TreeWalker
to the next visible node in document
order relative to the current node, and returns the new node. If the
current node has no next node, or if the search for nextNode attempts
to step upward from the TreeWalker's root node, returns
null
, and retains the current node.
null
if the current node has no
next node in the TreeWalker's logical view.public int getLastPos(XPathContext xctxt)
getLastPos
in interface SubContextList
getLastPos
in class PredicatedNodeTest
xctxt
- XPath runtime context.
public void setDefaultDTM(DTM dtm)
dtm
- Non-null reference to a DTM.public DTM getDTM(int node)
public boolean isDocOrdered()
public int getAxis()
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
callVisitors
in interface XPathVisitable
callVisitors
in class NodeTest
owner
- The owner of the visitor, where that path may be
rewritten if needed.visitor
- The visitor whose appropriate method will be called.XPathVisitable.callVisitors(ExpressionOwner, XPathVisitor)
public Expression getExpression()
ExpressionOwner
getExpression
in interface ExpressionOwner
ExpressionOwner.getExpression()
public void setExpression(Expression exp)
ExpressionOwner
setExpression
in interface ExpressionOwner
exp
- the raw Expression object, which should not normally be null.ExpressionOwner.setExpression(Expression)
public boolean deepEquals(Expression expr)
Expression
deepEquals
in class PredicatedNodeTest
expr
- Another expression object.
Expression.deepEquals(Expression)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |