SelfIteratorNoPredicatepublic class SelfIteratorNoPredicate extends LocPathIterator This class implements an optimized iterator for
"." patterns, that is, the self axes without any predicates. |
Fields Summary |
---|
static final long | serialVersionUID |
Constructors Summary |
---|
SelfIteratorNoPredicate(Compiler compiler, int opPos, int analysis)Create a SelfIteratorNoPredicate object.
super(compiler, opPos, analysis, false);
| public SelfIteratorNoPredicate()Create a SelfIteratorNoPredicate object.
super(null);
|
Methods Summary |
---|
public int | asNode(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.
return xctxt.getCurrentNode();
| public int | getLastPos(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.
return 1;
| 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.
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;
}
|
|