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

SelfIteratorNoPredicate

public class SelfIteratorNoPredicate extends LocPathIterator
This class implements an optimized iterator for "." patterns, that is, the self axes without any predicates.
see
com.sun.org.apache.xpath.internal.axes.LocPathIterator
xsl.usage
advanced

Fields Summary
Constructors Summary
SelfIteratorNoPredicate(Compiler compiler, int opPos, int analysis)
Create a SelfIteratorNoPredicate 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.
param
analysis Analysis bits.
throws
javax.xml.transform.TransformerException

    super(compiler, opPos, analysis, false);
  
public SelfIteratorNoPredicate()
Create a SelfIteratorNoPredicate 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.
param
analysis Analysis bits.
throws
javax.xml.transform.TransformerException

    super(null);
  
Methods Summary
public intasNode(com.sun.org.apache.xpath.internal.XPathContext xctxt)
Return the first node out of the nodeset, if this expression is a nodeset expression. This is the default implementation for nodesets. Derived classes should try and override this and return a value without having to do a clone operation.

param
xctxt The XPath runtime context.
return
the first node out of the nodeset, or DTM.NULL.

    return xctxt.getCurrentNode();
  
public intgetLastPos(com.sun.org.apache.xpath.internal.XPathContext xctxt)
Get the index of the last node that can be itterated to. This probably will need to be overridded by derived classes.

param
xctxt XPath runtime context.
return
the index of the last node that can be itterated to.

    return 1;
  
public intnextNode()
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.

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

    if (m_foundLast)
      return DTM.NULL;
      
    int next;
    DTM dtm = m_cdtm;

    m_lastFetched = next = (DTM.NULL == m_lastFetched)
                           ? m_context
                           : DTM.NULL;

    // m_lastFetched = next;
    if (DTM.NULL != next)
    {
      m_pos++;

      return next;
    }
    else
    {
      m_foundLast = true;

      return DTM.NULL;
    }