com.icl.saxon.expr

Class FilterEnumerator

Implemented Interfaces:
NodeEnumeration

public class FilterEnumerator
extends java.lang.Object
implements NodeEnumeration

A FilterEnumerator filters an input NodeEnumeration using a filter expression. The complication is that on request, it must determine the value of the last() position, which requires a lookahead.

Constructor Summary

FilterEnumerator(NodeEnumeration base, Expression filter, Context context, boolean finishAfterReject)
Constructor

Method Summary

boolean
hasMoreElements()
Test whether there are any more nodes available in the enumeration
boolean
isPeer()
Determine whether the nodes are guaranteed to be peers
boolean
isReverseSorted()
Determine whether the nodes returned by this enumeration are known to be in reverse document order.
boolean
isSorted()
Determine whether the nodes are guaranteed to be in document order
NodeInfo
nextElement()
Get the next node if there is one

Constructor Details

FilterEnumerator

public FilterEnumerator(NodeEnumeration base,
                        Expression filter,
                        Context context,
                        boolean finishAfterReject)
            throws XPathException
Constructor
Parameters:
base - A node-set expression denoting the absolute or relative set of nodes from which the navigation path should start.
filter - The expression defining the filter predicate
context - The context in which the expression is being evaluated

Method Details

hasMoreElements

public boolean hasMoreElements()
Test whether there are any more nodes available in the enumeration
Specified by:
hasMoreElements in interface NodeEnumeration

isPeer

public boolean isPeer()
Determine whether the nodes are guaranteed to be peers
Specified by:
isPeer in interface NodeEnumeration

isReverseSorted

public boolean isReverseSorted()
Determine whether the nodes returned by this enumeration are known to be in reverse document order.
Specified by:
isReverseSorted in interface NodeEnumeration
Returns:
true if the nodes are guaranteed to be in document order.

isSorted

public boolean isSorted()
Determine whether the nodes are guaranteed to be in document order
Specified by:
isSorted in interface NodeEnumeration

nextElement

public NodeInfo nextElement()
            throws XPathException
Get the next node if there is one
Specified by:
nextElement in interface NodeEnumeration