net.sf.saxon.expr
public abstract class UnaryExpression extends Expression
Field Summary | |
---|---|
protected Expression | operand |
Constructor Summary | |
---|---|
UnaryExpression(Expression p0) |
Method Summary | |
---|---|
int | computeCardinality()
Determine the static cardinality. |
int | computeSpecialProperties()
Get the static properties of this expression (other than its type). |
protected String | displayExpressionName()
Return the element name to use in the expression tree |
protected String | displayOperator(Configuration config)
Give a string representation of the operator for use in diagnostics |
boolean | equals(Object other)
Is this expression the same as another expression? |
void | explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
Expression | getBaseExpression() |
ItemType | getItemType(TypeHierarchy th)
Determine the data type of the expression, if possible. |
int | hashCode()
get HashCode for comparing two expressions. |
Iterator<Expression> | iterateSubExpressions()
Get the immediate subexpressions of this expression |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType)
Perform optimisation of an expression and its subexpressions.
|
Expression | promote(PromotionOffer offer, Expression parent)
Promote this expression if possible |
boolean | replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression |
Expression | simplify(ExpressionVisitor visitor)
Simplify an expression |
String | toString()
The toString() method for an expression attempts to give a representation of the expression
in an XPath-like form, but there is no guarantee that the syntax will actually be true XPath.
|
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType)
Type-check the expression. |
Parameters: config
Returns: the operator, as a string
Parameters: th the type hierarchy cache
Returns: the item type of the items in the result sequence, insofar as this is known statically.
This method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.
Parameters: visitor an expression visitor contextItemType the static type of "." at the point where this expression is invoked. The parameter is set to null if it is known statically that the context item will be undefined. If the type of the context item is not known statically, the argument is set to ITEM_TYPE
Returns: the original expression, rewritten if appropriate to optimize execution
Throws: XPathException if an error is discovered during this phase (typically a type error)
Parameters: original the original subexpression replacement the replacement subexpression
Returns: true if the original subexpression is found
Parameters: visitor an expression visitor
Returns: the simplified expression