org.apache.xpath.axes

Class WalkingIterator

public class WalkingIterator extends LocPathIterator implements ExpressionOwner

Location path iterator that uses Walkers.
Constructor Summary
WalkingIterator(PrefixResolver nscontext)
Create a WalkingIterator object.
Method Summary
voidcallVisitors(ExpressionOwner owner, XPathVisitor visitor)
Objectclone()
Get a cloned WalkingIterator that holds the same position as this iterator.
booleandeepEquals(Expression expr)
voiddetach()
Detaches the iterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.
voidfixupVariables(Vector vars, int globalsSize)
This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.
intgetAnalysisBits()
Get the analysis bits for this walker, as defined in the WalkerFactory.
ExpressiongetExpression()
AxesWalkergetFirstWalker()
Get the head of the walker list.
AxesWalkergetLastUsedWalker()
Get the last used walker.
intnextNode()
Returns the next node in the set and advances the position of the iterator in the set.
voidreset()
Reset the iterator.
voidsetExpression(Expression exp)
voidsetFirstWalker(AxesWalker walker)
Set the head of the walker list.
voidsetLastUsedWalker(AxesWalker walker)
Set the last used walker.
voidsetRoot(int context, Object environment)
Initialize the context values for this expression after it is cloned.

Constructor Detail

WalkingIterator

public WalkingIterator(PrefixResolver nscontext)
Create a WalkingIterator object.

Parameters: nscontext The namespace context for this iterator, should be OK if null.

Method Detail

callVisitors

public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)

See Also: XPathVisitable

clone

public Object clone()
Get a cloned WalkingIterator that holds the same position as this iterator.

Returns: A clone of this iterator that holds the same node position.

Throws: CloneNotSupportedException

deepEquals

public boolean deepEquals(Expression expr)

See Also: deepEquals

detach

public void detach()
Detaches the iterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state. Afterdetach has been invoked, calls to nextNode orpreviousNode will raise the exception INVALID_STATE_ERR.

fixupVariables

public void fixupVariables(Vector vars, int globalsSize)
This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.

Parameters: vars List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corresponds to the variable reference qname. The position of the QName in the vector from the start of the vector will be its position in the stack frame (but variables above the globalsTop value will need to be offset to the current stack frame).

getAnalysisBits

public int getAnalysisBits()
Get the analysis bits for this walker, as defined in the WalkerFactory.

Returns: One of WalkerFactory#BIT_DESCENDANT, etc.

getExpression

public Expression getExpression()

See Also: getExpression

getFirstWalker

public final AxesWalker getFirstWalker()
Get the head of the walker list.

Returns: The head of the walker list, or null if this iterator does not implement walkers.

UNKNOWN: advanced

getLastUsedWalker

public final AxesWalker getLastUsedWalker()
Get the last used walker.

Returns: The last used walker, or null.

UNKNOWN: advanced

nextNode

public int nextNode()
Returns the next node in the set and advances the position of the iterator in the set. After a NodeIterator is created, the first call to nextNode() returns the first node in the set.

Returns: The next Node in the set being iterated over, or null if there are no more members in that set.

reset

public void reset()
Reset the iterator.

setExpression

public void setExpression(Expression exp)

See Also: setExpression

setFirstWalker

public final void setFirstWalker(AxesWalker walker)
Set the head of the walker list.

Parameters: walker Should be a valid AxesWalker.

UNKNOWN: advanced

setLastUsedWalker

public final void setLastUsedWalker(AxesWalker walker)
Set the last used walker.

Parameters: walker The last used walker, or null.

UNKNOWN: advanced

setRoot

public void setRoot(int context, Object environment)
Initialize the context values for this expression after it is cloned.

Parameters: context The XPath runtime context for this transformation.

Copyright B) 2005 Apache XML Project. All Rights Reserved.