net.sf.saxon.expr
public class LazyExpression extends UnaryExpression
Note that the LazyExpression class does not itself implement any kind of delayed evaluation: calling its evaluateItem() and iterate() methods produces an immediate result. Instead, the existence of a LazyExpression on the expression tree acts as a signal to other classes that evaluation should be delayed, typically by holding the result of the iterate() method in a Closure object.
Constructor Summary | |
---|---|
LazyExpression(Expression operand)
Create a LazyExpression |
Method Summary | |
---|---|
Expression | copy()
Copy an expression. |
protected String | displayExpressionName() |
Item | evaluateItem(XPathContext context)
Evaluate an expression as a single item. |
SequenceIterator | iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence. |
static Expression | makeLazyExpression(Expression operand)
Create a LazyExpression (factory method) |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType)
Perform optimisation of an expression and its subexpressions. |
void | process(XPathContext context)
Process the instruction, without returning any tail calls
|
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType)
The typeCheck method suppresses compile-time evaluation |
Parameters: operand the expression to be evaluated lazily
Returns: the copy of the original expression
Parameters: context The context in which the expression is to be evaluated
Returns: the node or atomic value that results from evaluating the expression; or null to indicate that the result is an empty sequence
Throws: net.sf.saxon.trans.XPathException if any dynamic error occurs evaluating the expression
Parameters: context supplies the context for evaluation
Returns: a SequenceIterator that can be used to iterate over the result of the expression
Throws: net.sf.saxon.trans.XPathException if any dynamic error occurs evaluating the expression
Parameters: operand the expression to be evaluated lazily
Returns: the LazyExpression
Parameters: context The dynamic context, giving access to the current node, the current variables, etc.
Parameters: visitor an expression visitor contextItemType the static type of the context item
Returns: the expression after typechecking
Throws: XPathException