public abstract class NumericPromoter extends UnaryExpression
operand
EVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, PUSH_SELECTION, staticProperties, WATCH_METHOD
Constructor and Description |
---|
NumericPromoter(Expression exp) |
Modifier and Type | Method and Description |
---|---|
Item |
evaluateItem(XPathContext context)
Evaluate as an Item.
|
void |
explain(ExpressionPresenter out)
Diagnostic print of expression structure.
|
SequenceIterator |
iterate(XPathContext context)
Iterate over the sequence of values
|
Expression |
optimize(ExpressionVisitor visitor,
ItemType contextItemType)
Optimize the expression
|
protected abstract AtomicValue |
promote(AtomicValue value,
ConversionRules rules)
Perform the promotion
|
Expression |
simplify(ExpressionVisitor visitor)
Simplify an expression
|
Expression |
typeCheck(ExpressionVisitor visitor,
ItemType contextItemType)
Type-check the expression
|
computeCardinality, computeSpecialProperties, displayOperator, equals, getBaseExpression, getItemType, hashCode, iterateSubExpressions, promote, replaceSubExpression, toString
addToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, copy, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getExpressionName, getHostLanguage, getImplementationMethod, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, typeError
public NumericPromoter(Expression exp)
public Expression simplify(ExpressionVisitor visitor) throws XPathException
simplify
in class UnaryExpression
visitor
- an expression visitorXPathException
- if an error is discovered during expression
rewritingpublic Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException
typeCheck
in class UnaryExpression
visitor
- an expression visitorcontextItemType
- 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
Type.ITEM_TYPE
XPathException
- if an error is discovered during this phase
(typically a type error)public Expression optimize(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException
optimize
in class UnaryExpression
visitor
- an expression visitorcontextItemType
- 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
Type.ITEM_TYPE
XPathException
- if an error is discovered during this phase
(typically a type error)public SequenceIterator iterate(XPathContext context) throws XPathException
iterate
in interface SequenceIterable
iterate
in class Expression
context
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionpublic Item evaluateItem(XPathContext context) throws XPathException
evaluateItem
in interface EvaluableItem
evaluateItem
in class Expression
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionprotected abstract AtomicValue promote(AtomicValue value, ConversionRules rules) throws XPathException
value
- the numeric or untyped atomic value to be promotedrules
- XPathException
public void explain(ExpressionPresenter out)
explain
in class UnaryExpression
out
- the expression presenter used to display the structure