public class SingletonComparison extends BinaryExpression implements ComparisonExpression
operand0, operand1, operatorEVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, PUSH_SELECTION, staticProperties, WATCH_METHOD| Constructor and Description |
|---|
SingletonComparison(Expression p1,
int operator,
Expression p2,
boolean checkTypes)
Create a singleton comparison - that is, a comparison between two singleton (0:1) sequences
using the general comparison semantics
|
| Modifier and Type | Method and Description |
|---|---|
int |
computeCardinality()
Determine the static cardinality.
|
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)
Evaluate the expression in a boolean context
|
Item |
evaluateItem(XPathContext context)
Evaluate the expression in a given context
|
protected void |
explainExtraAttributes(ExpressionPresenter out)
Add subclass-specific attributes to the expression tree explanation.
|
AtomicComparer |
getAtomicComparer()
Get the AtomicComparer used to compare atomic values.
|
ItemType |
getItemType(TypeHierarchy th)
Determine the data type of the expression
|
int |
getSingletonOperator()
Get the primitive (singleton) operator used: one of Token.FEQ, Token.FNE, Token.FLT, Token.FGT,
Token.FLE, Token.FGE
|
boolean |
needsRuntimeComparabilityCheck()
Determine whether a run-time check is needed to check that the types of the arguments
are comparable
|
void |
setAtomicComparer(AtomicComparer comp) |
computeSpecialProperties, displayOperator, equals, explain, getOperands, getOperator, hashCode, isAssociative, isCommutative, isInverse, iterateSubExpressions, optimize, promote, replaceSubExpression, setFlattened, simplify, toString, typeCheckaddToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, 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, iterate, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setLocationId, staticTypeCheck, suppressValidation, typeErrorclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetOperandspublic SingletonComparison(Expression p1, int operator, Expression p2, boolean checkTypes)
p1 - the first operandoperator - the operatorp2 - the second operandcheckTypes - true if a run-time check for comparability of the operand types is neededpublic void setAtomicComparer(AtomicComparer comp)
public AtomicComparer getAtomicComparer()
ComparisonExpressiongetAtomicComparer in interface ComparisonExpressionpublic int getSingletonOperator()
ComparisonExpressiongetSingletonOperator in interface ComparisonExpressionpublic boolean convertsUntypedToOther()
convertsUntypedToOther in interface ComparisonExpressionpublic int computeCardinality()
computeCardinality in class BinaryExpressionStaticProperty.ALLOWS_ZERO_OR_ONE,
StaticProperty.EXACTLY_ONE, StaticProperty.ALLOWS_ONE_OR_MORE,
StaticProperty.ALLOWS_ZERO_OR_MOREpublic ItemType getItemType(TypeHierarchy th)
getItemType in class Expressionth - the type hierarchy cachepublic Expression copy()
copy in class Expressionpublic boolean needsRuntimeComparabilityCheck()
public Item evaluateItem(XPathContext context) throws XPathException
evaluateItem in interface EvaluableItemevaluateItem in class Expressioncontext - the given context for evaluationXPathException - if any dynamic error occurs evaluating the
expressionpublic boolean effectiveBooleanValue(XPathContext context) throws XPathException
effectiveBooleanValue in class Expressioncontext - the given context for evaluationXPathException - if any dynamic error occurs evaluating the
expressionprotected void explainExtraAttributes(ExpressionPresenter out)
BinaryExpressionexplainExtraAttributes in class BinaryExpressionout - the output destination for the displayed expression tree