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 |
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()
Copy an expression.
|
boolean |
effectiveBooleanValue(XPathContext context)
Get the effective boolean value of the expression.
|
boolean |
equals(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
|
ExpressionCompiler |
getExpressionCompiler()
Return the compiler of the CompareToIntegerConstant expression
|
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
|
int |
hashCode()
Hashcode supporting equals()
|
Expression |
optimize(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Perform optimisation of an expression and its subexpressions.
|
String |
toShortString()
Produce a short string identifying the expression for use in error messages
|
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, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, clearStreamabilityData, computeDependencies, computeStaticProperties, doPromotion, dynamicError, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getExpressionName, getHostLanguage, getIntegerBounds, getIntrinsicDependencies, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getPosture, getPostureAndSweepIfKnown, getProperties, getProperty, getRetainedStaticContext, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStreamability, getStreamingAdjunct, getSweep, getSystemId, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterate, iterateEvents, makeStreamingAdjunct, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, optimizeForType, process, promote, promoteChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setFiltered, setFlattened, setLocation, setParentExpression, setPostureAndSweep, setRetainedStaticContext, setRetainedStaticContextLocally, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toStreamingPattern, typeCheckChildren, typeError, unorderedpublic 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()
copy in class Expressionpublic boolean equals(Object other)
equals in class UnaryExpressionother - the expression to be compared with this onepublic int hashCode()
hashCode 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 ExpressionCompiler getExpressionCompiler()
getExpressionCompiler 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)
export in class UnaryExpressiondestination - the expression presenter used to display the structurepublic 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 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-2014 Saxonica Limited. All rights reserved.