Package net.sf.saxon.expr.compat
Class GeneralComparison10
- java.lang.Object
- 
- net.sf.saxon.expr.Expression
- 
- net.sf.saxon.expr.BinaryExpression
- 
- net.sf.saxon.expr.compat.GeneralComparison10
 
 
 
- 
- All Implemented Interfaces:
- Callable,- ExportAgent,- Locatable,- IdentityComparable,- Traceable
 
 public class GeneralComparison10 extends BinaryExpression implements Callable GeneralComparison10: a boolean expression that compares two expressions for equals, not-equals, greater-than or less-than. This implements the operators =, !=, <, >, etc. This version of the class implements general comparisons in XPath 1.0 backwards compatibility mode.
- 
- 
Field SummaryFields Modifier and Type Field Description protected AtomicComparercomparerprotected intsingletonOperator- 
Fields inherited from class net.sf.saxon.expr.BinaryExpressionoperator
 - 
Fields inherited from class net.sf.saxon.expr.ExpressionEFFECTIVE_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 SummaryConstructors Constructor Description GeneralComparison10(Expression p0, int op, Expression p1)Create a general comparison identifying the two operands and the operator
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanValuecall(XPathContext context, Sequence[] arguments)Evaluate the expression: interface for use by compiled bytecodeprotected intcomputeCardinality()Determine the static cardinality.Expressioncopy(RebindingMap rebindings)Copy an expression.booleaneffectiveBooleanValue(XPathContext context)Evaluate the expression giving a boolean resultBooleanValueevaluateItem(XPathContext context)Evaluate the expression in a given contextprotected voidexplainExtraAttributes(ExpressionPresenter out)Add subclass-specific attributes to the expression tree explanation.ItemTypegetItemType()Determine the data type of the expressionExpressionoptimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo)Optimize the expressionvoidsetAtomicComparer(AtomicComparer comparer)protected java.lang.Stringtag()Get the element name used to identify this expression in exported expression formatExpressiontypeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo)Type-check the expression- 
Methods inherited from class net.sf.saxon.expr.BinaryExpressioncomputeHashCode, computeSpecialProperties, displayOperator, equals, export, getImplementationMethod, getLhs, getLhsExpression, getOperandRole, getOperator, getRhs, getRhsExpression, isAssociative, isCommutative, isInverse, operands, setFlattened, setLhsExpression, setRhsExpression, toShortString, toString
 - 
Methods inherited from class net.sf.saxon.expr.ExpressionaddToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, dynamicError, 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, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, typeCheckChildren, typeError, unordered, verifyParentPointers
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface net.sf.saxon.trace.TraceablegatherProperties
 
- 
 
- 
- 
- 
Field Detail- 
singletonOperatorprotected int singletonOperator 
 - 
comparerprotected AtomicComparer comparer 
 
- 
 - 
Constructor Detail- 
GeneralComparison10public GeneralComparison10(Expression p0, int op, Expression p1) Create a general comparison identifying the two operands and the operator- Parameters:
- p0- the left-hand operand
- op- the operator, as a token returned by the Tokenizer (e.g. Token.LT)
- p1- the right-hand operand
 
 
- 
 - 
Method Detail- 
computeCardinalityprotected int computeCardinality() Determine the static cardinality. Returns [1..1]- Overrides:
- computeCardinalityin class- BinaryExpression
- Returns:
- the computed cardinality, as one of the values StaticProperty.ALLOWS_ZERO_OR_ONE,StaticProperty.EXACTLY_ONE,StaticProperty.ALLOWS_ONE_OR_MORE,StaticProperty.ALLOWS_ZERO_OR_MORE. May also returnStaticProperty.ALLOWS_ZEROif the result is known to be an empty sequence, orStaticProperty.ALLOWS_MANYif if is known to return a sequence of length two or more.
 
 - 
typeCheckpublic Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException Type-check the expression- Overrides:
- typeCheckin class- BinaryExpression
- Parameters:
- visitor- an expression visitor
- contextInfo- Information available statically about the context item: whether it is (possibly) absent; its static type; its streaming posture.
- Returns:
- the checked expression
- Throws:
- XPathException- if an error is discovered during this phase (typically a type error)
 
 - 
setAtomicComparerpublic void setAtomicComparer(AtomicComparer comparer) 
 - 
optimizepublic Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException Optimize the expression- Overrides:
- optimizein class- BinaryExpression
- Parameters:
- visitor- an expression visitor
- contextInfo- 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
- Returns:
- the checked expression
- Throws:
- XPathException- if an error is discovered during this phase (typically a type error)
 
 - 
evaluateItempublic BooleanValue evaluateItem(XPathContext context) throws XPathException Evaluate the expression in a given context- Overrides:
- evaluateItemin class- Expression
- Parameters:
- context- the given context for evaluation
- Returns:
- a BooleanValue representing the result of the numeric comparison of the two operands
- Throws:
- XPathException- if any dynamic error occurs evaluating the expression
 
 - 
callpublic BooleanValue call(XPathContext context, Sequence[] arguments) throws XPathException Evaluate the expression: interface for use by compiled bytecode- Specified by:
- callin interface- Callable
- Parameters:
- context- the dynamic evaluation context
- arguments- the values of the arguments, supplied as SequenceIterators
- Returns:
- the result of the evaluation, in the form of a SequenceIterator
- Throws:
- XPathException- if a dynamic error occurs during the evaluation of the expression
 
 - 
effectiveBooleanValuepublic boolean effectiveBooleanValue(XPathContext context) throws XPathException Evaluate the expression giving a boolean result- Overrides:
- effectiveBooleanValuein class- Expression
- Parameters:
- context- the given context for evaluation
- Returns:
- a boolean representing the result of the comparison of the two operands
- Throws:
- XPathException- if any dynamic error occurs evaluating the expression
 
 - 
copypublic Expression copy(RebindingMap rebindings) Copy an expression. This makes a deep copy.- Specified by:
- copyin class- Expression
- Parameters:
- rebindings- variables that must be re-bound
- Returns:
- the copy of the original expression
 
 - 
getItemTypepublic ItemType getItemType() Determine the data type of the expression- Specified by:
- getItemTypein class- Expression
- Returns:
- Type.BOOLEAN
 
 - 
explainExtraAttributesprotected void explainExtraAttributes(ExpressionPresenter out) Description copied from class:BinaryExpressionAdd subclass-specific attributes to the expression tree explanation. Default implementation does nothing; this is provided for subclasses to override.- Overrides:
- explainExtraAttributesin class- BinaryExpression
- Parameters:
- out- the output destination for the displayed expression tree
 
 - 
tagprotected java.lang.String tag() Description copied from class:BinaryExpressionGet the element name used to identify this expression in exported expression format- Overrides:
- tagin class- BinaryExpression
- Returns:
- the element name used to identify this expression
 
 
- 
 
-