net.sf.saxon.expr
Class FilterIterator
java.lang.Object
net.sf.saxon.expr.FilterIterator
- SequenceIterator
public class FilterIterator
extends java.lang.Object
A FilterIterator filters an input sequence using a filter expression. Note that a FilterIterator
is not used where the filter is a constant number (PositionFilter is used for this purpose instead),
so this class does no optimizations for numeric predicates.
static class | FilterIterator.Leading - Subclass to support the extension function saxon:leading, which terminates
the iteration at the first item whose predicate is false
|
static class | FilterIterator.NonNumeric - Subclass to handle the common special case where it is statically known
that the filter cannot return a numeric value
|
FilterIterator
public FilterIterator(SequenceIterator base,
Expression filter,
XPathContext context)
Constructor
base
- An iteration of the items to be filteredfilter
- The expression defining the filter predicatecontext
- The context in which the expression is being evaluated
getNextMatchingItem
protected Item getNextMatchingItem()
throws XPathException
Get the next item in the base sequence that matches the filter predicate
if there is such an item, or null if not.
- the next item that matches the predicate
getProperties
public int getProperties()
Get properties of this iterator, as a bit-significant integer.
- getProperties in interface SequenceIterator
matches
protected boolean matches()
throws XPathException
Determine whether the context item matches the filter predicate
- true if the context item matches