public abstract class CompareToConstant extends UnaryExpression implements ComparisonExpression
| Modifier and Type | Field and Description |
|---|---|
protected int |
operator |
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD| Constructor and Description |
|---|
CompareToConstant(Expression p0) |
| Modifier and Type | Method and Description |
|---|---|
int |
computeSpecialProperties()
Get the static properties of this expression (other than its type).
|
boolean |
convertsUntypedToOther()
Determine whether untyped atomic values should be converted to the type of the other operand
|
BooleanValue |
evaluateItem(XPathContext context)
Evaluate an expression as a single item.
|
int |
getComparisonOperator()
Get the comparison operator
|
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
ItemType |
getItemType()
Determine the data type of the expression, if possible.
|
Operand |
getLhs()
Get the two operands of the comparison
|
Expression |
getLhsExpression() |
protected OperandRole |
getOperandRole()
Get the usage (in terms of streamability analysis) of the single operand
|
Operand |
getRhs() |
abstract Expression |
getRhsExpression() |
int |
getSingletonOperator()
Get the primitive (singleton) operator used: one of Token.FEQ, Token.FNE, Token.FLT, Token.FGT,
Token.FLE, Token.FGE
|
Expression |
optimize(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Perform optimisation of an expression and its subexpressions.
|
computeCardinality, computeHashCode, displayOperator, emitExtraAttributes, equals, export, getBaseExpression, getOperand, operands, setBaseExpression, toShortString, toString, typeCheckaddToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, copy, dynamicError, effectiveBooleanValue, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getCost, getDependencies, getEvaluationMethod, getExpressionName, getExtraProperty, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, getStreamerName, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterate, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, prepareForStreaming, process, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, typeCheckChildren, typeError, unordered, verifyParentPointersclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAtomicComparergatherPropertiespublic CompareToConstant(Expression p0)
protected OperandRole getOperandRole()
UnaryExpressiongetOperandRole in class UnaryExpressionpublic Expression getLhsExpression()
getLhsExpression in interface ComparisonExpressionpublic Operand getLhs()
ComparisonExpressiongetLhs in interface ComparisonExpressionpublic abstract Expression getRhsExpression()
getRhsExpression in interface ComparisonExpressionpublic Operand getRhs()
getRhs in interface ComparisonExpressionpublic int getComparisonOperator()
public int getImplementationMethod()
getImplementationMethod in class ExpressionExpression.EVALUATE_METHODpublic int computeSpecialProperties()
UnaryExpressioncomputeSpecialProperties in class UnaryExpressionpublic BooleanValue evaluateItem(XPathContext context) throws XPathException
evaluateItem in class Expressioncontext - The context in which the expression is to be evaluatedXPathException - if any dynamic error occurs evaluating the
expressionpublic Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
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.
optimize in class UnaryExpressionvisitor - the expression visitorcontextInfo - 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_TYPEXPathException - if an error is discovered during this phase
(typically a type error)public ItemType getItemType()
This method should always return a result, though it may be the best approximation that is available at the time.
getItemType in class UnaryExpressionpublic int getSingletonOperator()
getSingletonOperator in interface ComparisonExpressionpublic boolean convertsUntypedToOther()
convertsUntypedToOther in interface ComparisonExpressionCopyright (c) 2004-2020 Saxonica Limited.