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, typeCheck
addToPathMap, 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, unordered
public CompareToIntegerConstant(Expression operand, int operator, long comparand)
protected OperandRole getOperandRole()
UnaryExpression
getOperandRole
in class UnaryExpression
public Expression getLhsExpression()
getLhsExpression
in interface ComparisonExpression
public Operand getLhs()
ComparisonExpression
getLhs
in interface ComparisonExpression
public Expression getRhsExpression()
getRhsExpression
in interface ComparisonExpression
public Operand getRhs()
getRhs
in interface ComparisonExpression
public long getComparand()
public int getComparisonOperator()
public int getImplementationMethod()
getImplementationMethod
in class Expression
Expression.EVALUATE_METHOD
public int computeSpecialProperties()
UnaryExpression
computeSpecialProperties
in class UnaryExpression
public Expression copy()
copy
in class Expression
public boolean equals(Object other)
equals
in class UnaryExpression
other
- the expression to be compared with this onepublic int hashCode()
hashCode
in class UnaryExpression
public BooleanValue evaluateItem(XPathContext context) throws XPathException
evaluateItem
in class Expression
context
- 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 Expression
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionpublic int computeCardinality()
UnaryExpression
computeCardinality
in class UnaryExpression
StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
public 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 UnaryExpression
visitor
- 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_TYPE
XPathException
- if an error is discovered during this phase
(typically a type error)public ExpressionCompiler getExpressionCompiler()
getExpressionCompiler
in class Expression
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 UnaryExpression
public void export(ExpressionPresenter destination)
export
in class UnaryExpression
destination
- 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 UnaryExpression
public String toShortString()
toShortString
in class UnaryExpression
public AtomicComparer getAtomicComparer()
getAtomicComparer
in interface ComparisonExpression
public int getSingletonOperator()
getSingletonOperator
in interface ComparisonExpression
public boolean convertsUntypedToOther()
convertsUntypedToOther
in interface ComparisonExpression
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.