org.apache.xpath.axes

Class FilterExprIteratorSimple

public class FilterExprIteratorSimple extends LocPathIterator

Class to use for one-step iteration that doesn't have a predicate, and doesn't need to set the context.
Constructor Summary
FilterExprIteratorSimple()
Create a FilterExprIteratorSimple object.
FilterExprIteratorSimple(Expression expr)
Create a FilterExprIteratorSimple object.
Method Summary
voidcallPredicateVisitors(XPathVisitor visitor)
This will traverse the heararchy, calling the visitor for each member.
booleandeepEquals(Expression expr)
voiddetach()
Detaches the walker from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.
static XNodeSetexecuteFilterExpr(int context, XPathContext xctxt, PrefixResolver prefixResolver, boolean isTopLevel, int stackFrame, Expression expr)
Execute the expression.
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.
intgetAxis()
Returns the axis being iterated, if it is known.
ExpressiongetInnerExpression()
Get the inner contained expression of this filter.
booleanisDocOrdered()
Returns true if all the nodes in the iteration well be returned in document order.
intnextNode()
Returns the next node in the set and advances the position of the iterator in the set.
voidsetInnerExpression(Expression expr)
Set the inner contained expression of this filter.
voidsetRoot(int context, Object environment)
Initialize the context values for this expression after it is cloned.

Constructor Detail

FilterExprIteratorSimple

public FilterExprIteratorSimple()
Create a FilterExprIteratorSimple object.

FilterExprIteratorSimple

public FilterExprIteratorSimple(Expression expr)
Create a FilterExprIteratorSimple object.

Method Detail

callPredicateVisitors

public void callPredicateVisitors(XPathVisitor visitor)
This will traverse the heararchy, calling the visitor for each member. If the called visitor method returns false, the subtree should not be called.

Parameters: visitor The visitor whose appropriate method will be called.

deepEquals

public boolean deepEquals(Expression expr)

See Also: deepEquals

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.

executeFilterExpr

public static XNodeSet executeFilterExpr(int context, XPathContext xctxt, PrefixResolver prefixResolver, boolean isTopLevel, int stackFrame, Expression expr)
Execute the expression. Meant for reuse by other FilterExpr iterators that are not derived from this object.

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.

getAxis

public int getAxis()
Returns the axis being iterated, if it is known.

Returns: Axis.CHILD, etc., or -1 if the axis is not known or is of multiple types.

getInnerExpression

public Expression getInnerExpression()
Get the inner contained expression of this filter.

isDocOrdered

public boolean isDocOrdered()
Returns true if all the nodes in the iteration well be returned in document order. Warning: This can only be called after setRoot has been called!

Returns: true as a default.

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.

setInnerExpression

public void setInnerExpression(Expression expr)
Set the inner contained expression of this filter.

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) 2006 Apache XML Project. All Rights Reserved.