FileDocCategorySizeDatePackage
OneStepIteratorForward.javaAPI DocJava SE 5 API4913Fri Aug 26 14:56:06 BST 2005com.sun.org.apache.xpath.internal.axes

OneStepIteratorForward

public class OneStepIteratorForward extends ChildTestIterator
This class implements a general iterator for those LocationSteps with only one step, and perhaps a predicate, that only go forward (i.e. it can not be used with ancestors, preceding, etc.)
see
com.sun.org.apache.xpath.internal.axes#ChildTestIterator
xsl.usage
advanced

Fields Summary
protected int
m_axis
The traversal axis from where the nodes will be filtered.
Constructors Summary
OneStepIteratorForward(Compiler compiler, int opPos, int analysis)
Create a OneStepIterator object.

param
compiler A reference to the Compiler that contains the op map.
param
opPos The position within the op map, which contains the location path expression for this itterator.
throws
javax.xml.transform.TransformerException


                                        
       
           
  
    super(compiler, opPos, analysis);
    int firstStepPos = compiler.getFirstChildPos(opPos);
    
    m_axis = WalkerFactory.getAxisFromStep(compiler, firstStepPos);
    
  
public OneStepIteratorForward(int axis)
Create a OneStepIterator object that will just traverse the self axes.

param
axis One of the com.sun.org.apache.xml.internal.dtm.Axis integers.
throws
javax.xml.transform.TransformerException

    super(null);
    
    m_axis = axis;
    int whatToShow = DTMFilter.SHOW_ALL;
    initNodeTest(whatToShow);
  
Methods Summary
public booleandeepEquals(com.sun.org.apache.xpath.internal.Expression expr)

see
Expression#deepEquals(Expression)

  	if(!super.deepEquals(expr))
  		return false;
  		
  	if(m_axis != ((OneStepIteratorForward)expr).m_axis)
  		return false;
  		
  	return true;
  
public intgetAxis()
Returns the axis being iterated, if it is known.

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

    return m_axis;
  
protected intgetNextNode()
Get the next node via getFirstAttribute && getNextAttribute.

    m_lastFetched = (DTM.NULL == m_lastFetched)
                     ? m_traverser.first(m_context)
                     : m_traverser.next(m_context, m_lastFetched);
    return m_lastFetched;
  
public voidsetRoot(int context, java.lang.Object environment)
Initialize the context values for this expression after it is cloned.

param
execContext The XPath runtime context for this transformation.

    super.setRoot(context, environment);
    m_traverser = m_cdtm.getAxisTraverser(m_axis);