org.apache.xalan.xsltc.dom
Class MatchingIterator
public final
class
MatchingIterator
extends DTMAxisIteratorBase
This is a special kind of iterator that takes a source iterator and a
node N. If initialized with a node M (the parent of N) it computes the
position of N amongst the children of M. This position can be obtained
by calling getPosition().
It is an iterator even though next() will never be called. It is used to
match patterns with a single predicate like:
BOOK[position() = last()]
In this example, the source iterator will return elements of type BOOK,
a call to position() will return the position of N. Notice that because
of the way the pattern matching is implemented, N will always be a node
in the source since (i) it is a BOOK or the test sequence would not be
considered and (ii) the source iterator is initialized with M which is
the parent of N. Also, and still in this example, a call to last() will
return the number of elements in the source (i.e. the number of BOOKs).
Author: Jacek Ambroziak Santiago Pericas-Geertsen
public int getLast()
public int getPosition()
public void gotoMark()
public int next()
public void setMark()
public void setRestartable(boolean isRestartable)
Copyright B) 2006 Apache XML Project. All Rights Reserved.