FileDocCategorySizeDatePackage
FilterExprIterator.javaAPI DocJava SE 6 API5577Tue Jun 10 00:23:14 BST 2008com.sun.org.apache.xpath.internal.axes

FilterExprIterator

public class FilterExprIterator extends BasicTestIterator

Fields Summary
static final long
serialVersionUID
private Expression
m_expr
The contained expression. Should be non-null.
private transient XNodeSet
m_exprObj
The result of executing m_expr. Needs to be deep cloned on clone op.
private boolean
m_mustHardReset
private boolean
m_canDetachNodeset
Constructors Summary
public FilterExprIterator()
Create a FilterExprIterator object.


         
   
  
    super(null);
  
public FilterExprIterator(Expression expr)
Create a FilterExprIterator object.

    super(null);
    m_expr = expr;
  
Methods Summary
public voidcallPredicateVisitors(com.sun.org.apache.xpath.internal.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.

param
visitor The visitor whose appropriate method will be called.

    m_expr.callVisitors(new filterExprOwner(), visitor);

    super.callPredicateVisitors(visitor);
  
public booleandeepEquals(com.sun.org.apache.xpath.internal.Expression expr)

see
Expression#deepEquals(Expression)

    if (!super.deepEquals(expr))
      return false;

    FilterExprIterator fet = (FilterExprIterator) expr;
    if (!m_expr.deepEquals(fet.m_expr))
      return false;

    return true;
  
public voiddetach()
Detaches the walker from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.

  
  	super.detach();
  	m_exprObj.detach();
  	m_exprObj = null;
  
public voidfixupVariables(java.util.Vector vars, int globalsSize)
This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.

param
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).

    super.fixupVariables(vars, globalsSize);
    m_expr.fixupVariables(vars, globalsSize);
  
public intgetAnalysisBits()
Get the analysis bits for this walker, as defined in the WalkerFactory.

return
One of WalkerFactory#BIT_DESCENDANT, etc.

    if (null != m_expr && m_expr instanceof PathComponent)
    {
      return ((PathComponent) m_expr).getAnalysisBits();
    }
    return WalkerFactory.BIT_FILTER;
  
public com.sun.org.apache.xpath.internal.ExpressiongetInnerExpression()
Get the inner contained expression of this filter.

    return m_expr;
  
protected intgetNextNode()
Get the next node via getNextXXX. Bottlenecked for derived class override.

return
The next node on the axis, or DTM.NULL.

    if (null != m_exprObj)
    {
      m_lastFetched = m_exprObj.nextNode();
    }
    else
      m_lastFetched = DTM.NULL;

    return m_lastFetched;
  
public booleanisDocOrdered()
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!

return
true as a default.

    return m_exprObj.isDocOrdered();
  
public voidsetInnerExpression(com.sun.org.apache.xpath.internal.Expression expr)
Set the inner contained expression of this filter.

    expr.exprSetParent(this);
    m_expr = expr;
  
public voidsetRoot(int context, java.lang.Object environment)
Initialize the context values for this expression after it is cloned.

param
context The XPath runtime context for this transformation.

  	super.setRoot(context, environment);
 	
  	m_exprObj = FilterExprIteratorSimple.executeFilterExpr(context, 
  	                  m_execContext, getPrefixResolver(), 
  	                  getIsTopLevel(), m_stackFrame, m_expr);