net.sf.saxon.expr
public abstract class SimpleExpression extends Expression
Field Summary | |
---|---|
protected Expression[] | arguments |
static Expression[] | NO_ARGUMENTS |
Constructor Summary | |
---|---|
SimpleExpression()
Constructor |
Method Summary | |
---|---|
int | computeCardinality()
Determine the static cardinality of the expression. |
int | computeDependencies()
Compute the dependencies of an expression, as the union of the
dependencies of its subexpressions. |
Expression | copy()
Copy an expression. |
Item | evaluateItem(XPathContext context)
Evaluate an expression as a single item. |
void | explain(ExpressionPresenter destination)
Diagnostic print of expression structure. |
String | getExpressionType()
Return a distinguishing name for the expression, for use in diagnostics.
|
ItemType | getItemType(TypeHierarchy th)
Determine the data type of the items returned by this expression. |
SequenceIterator | iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence. |
Iterator<Expression> | iterateSubExpressions()
Get the immediate sub-expressions of this expression. |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType) |
void | process(XPathContext context)
Process the instruction, without returning any tail calls |
Expression | promote(PromotionOffer offer, Expression parent)
Offer promotion for this subexpression. |
boolean | replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression |
void | setArguments(Expression[] sub)
Set the immediate sub-expressions of this expression. |
Expression | simplify(ExpressionVisitor visitor)
Simplify the expression |
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType) |
Returns: the depencies, as a bit-mask
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: XPathException if any dynamic error occurs evaluating the expression
Returns: a distinguishing name for the expression (defaults to the name of the implementation class)
Parameters: th the type hierarchy cache
Returns: the data type
Parameters: context supplies the context for evaluation
Returns: a SequenceIterator that can be used to iterate over the result of the expression
Throws: XPathException if any dynamic error occurs evaluating the expression
Returns: an array containing the sub-expressions of this expression
Parameters: context The dynamic context, giving access to the current node, the current variables, etc.
Parameters: offer details of the offer, for example the offer to move expressions that don't depend on the context to an outer level in the containing expression parent
Returns: if the offer is not accepted, return this expression unchanged. Otherwise return the result of rewriting the expression to promote this subexpression
Throws: XPathException if any error is detected
Parameters: original the original subexpression replacement the replacement subexpression
Returns: true if the original subexpression is found
Parameters: sub an array containing the sub-expressions of this expression
Parameters: visitor an expression visitor
Returns: the simplified expression