public class CompareToIntegerConstant extends UnaryExpression implements ComparisonExpression
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD| Constructor and Description |
|---|
CompareToIntegerConstant(Expression operand,
int operator,
long comparand)
Create the expression
|
| Modifier and Type | Method and Description |
|---|---|
int |
computeCardinality()
Determine the static cardinality.
|
int |
computeHashCode()
Hashcode supporting equals()
|
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
|
Expression |
copy(RebindingMap rebindings)
Copy an expression.
|
boolean |
effectiveBooleanValue(XPathContext context)
Get the effective boolean value of the expression.
|
boolean |
equals(java.lang.Object other)
Is this expression the same as another expression?
|
BooleanValue |
evaluateItem(XPathContext context)
Evaluate an expression as a single item.
|
void |
export(ExpressionPresenter destination)
Diagnostic print of expression structure.
|
AtomicComparer |
getAtomicComparer()
Get the AtomicComparer used to compare atomic values.
|
long |
getComparand()
Get the integer value on the rhs of the expression
|
int |
getComparisonOperator()
Get the comparison operator
|
java.lang.String |
getExpressionName()
Get a name identifying the kind of expression, in terms meaningful to a user.
|
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() |
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.
|
java.lang.String |
toShortString()
Produce a short string identifying the expression for use in error messages
|
java.lang.String |
toString()
The toString() method for an expression attempts to give a representation of the expression
in an XPath-like form.
|
displayOperator, getBaseExpression, getOperand, operands, setBaseExpression, typeCheckaddToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, dynamicError, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getExtraProperty, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, getStreamerName, hasCompatibleStaticContext, hashCode, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isInstruction, isLiftable, isMultiThreaded, isSameExpression, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterate, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, process, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, typeCheckChildren, typeError, unordered, verifyParentPointers, verifyParentPointerspublic CompareToIntegerConstant(Expression operand, int operator, long comparand)
protected OperandRole getOperandRole()
UnaryExpressiongetOperandRole in class UnaryExpressionpublic Expression getLhsExpression()
getLhsExpression in interface ComparisonExpressionpublic Operand getLhs()
ComparisonExpressiongetLhs in interface ComparisonExpressionpublic Expression getRhsExpression()
getRhsExpression in interface ComparisonExpressionpublic Operand getRhs()
getRhs in interface ComparisonExpressionpublic long getComparand()
public int getComparisonOperator()
public int getImplementationMethod()
getImplementationMethod in class ExpressionExpression.EVALUATE_METHODpublic int computeSpecialProperties()
UnaryExpressioncomputeSpecialProperties in class UnaryExpressionpublic Expression copy(RebindingMap rebindings)
copy in class Expressionrebindings - public boolean equals(java.lang.Object other)
equals in class UnaryExpressionother - the expression to be compared with this onepublic int computeHashCode()
computeHashCode 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 boolean effectiveBooleanValue(XPathContext context) throws XPathException
effectiveBooleanValue in class Expressioncontext - The context in which the expression is to be evaluatedXPathException - if any dynamic error occurs evaluating the
expressionpublic int computeCardinality()
UnaryExpressioncomputeCardinality in class UnaryExpressionStaticProperty.ALLOWS_ZERO_OR_ONE,
StaticProperty.EXACTLY_ONE, StaticProperty.ALLOWS_ONE_OR_MORE,
StaticProperty.ALLOWS_ZERO_OR_MOREpublic 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 java.lang.String getExpressionName()
getExpressionName in class Expressionpublic 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 void export(ExpressionPresenter destination) throws XPathException
export in interface ExportAgentexport in class UnaryExpressiondestination - the expression presenter used to display the structureXPathException - if the export fails, for example if an expression is found that won't work
in the target environment.public java.lang.String toString()
The toString() method for an expression attempts to give a representation of the expression in an XPath-like form.
For subclasses of Expression that represent XPath expressions, the result should always be a string that parses as an XPath 3.0 expression
toString in class UnaryExpressionpublic java.lang.String toShortString()
toShortString in class UnaryExpressionpublic AtomicComparer getAtomicComparer()
getAtomicComparer in interface ComparisonExpressionpublic int getSingletonOperator()
getSingletonOperator in interface ComparisonExpressionpublic boolean convertsUntypedToOther()
convertsUntypedToOther in interface ComparisonExpressionCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.