Package net.sf.saxon.expr
Class SingletonIntersectExpression
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.BinaryExpression
net.sf.saxon.expr.VennExpression
net.sf.saxon.expr.SingletonIntersectExpression
- All Implemented Interfaces:
- ExportAgent,- Locatable,- IdentityComparable,- Traceable
This expression is equivalent to (A intersect B) in the case where A has cardinality
 zero-or-one. This is handled as a special case because the standard sort-merge algorithm
 involves an unnecessary sort on B.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classElaborator for a Venn expression: that isA union B,A intersect B, orA except BNested classes/interfaces inherited from class net.sf.saxon.expr.VennExpressionVennExpression.VennElaborator
- 
Field SummaryFields inherited from class net.sf.saxon.expr.BinaryExpressionoperatorFields 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 SummaryConstructorsConstructorDescriptionSingletonIntersectExpression(Expression p1, int op, Expression p2) Special case of an intersect expression where the first argument is a singleton
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleancontainsNode(SequenceIterator iter, NodeInfo m) Ask whether the sequence supplied in the first argument contains the node supplied in the secondcopy(RebindingMap rebindings) Copy an expression.protected StringDisplay the operator used by this binary expressionbooleanGet the effective boolean value.Make an elaborator for this expressionGet a name identifying the kind of expression, in terms meaningful to a user.Iterate over the value of the expression.optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) Perform optimisation of an expression and its subexpressions.simplify()Simplify the expressionprotected Stringtag()Get the element name used to identify this expression in exported expression formatMethods inherited from class net.sf.saxon.expr.VennExpressioncomputeCardinality, computeHashCode, computeSpecialProperties, equals, gatherComponents, getImplementationMethod, getItemType, getOperandRole, getStaticUType, getStreamerName, toPattern, typeCheck, unorderedMethods inherited from class net.sf.saxon.expr.BinaryExpressionexplainExtraAttributes, export, getLhs, getLhsExpression, getOperator, getRhs, getRhsExpression, isAssociative, isCommutative, isInverse, operands, setFlattened, setLhsExpression, setRhsExpression, toShortString, toStringMethods inherited from class net.sf.saxon.expr.ExpressionaddToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, dispatchTailCall, dynamicError, evaluateAsString, evaluateItem, explain, getCardinality, getConfiguration, getCost, getDependencies, getEvaluationMethod, getExtraProperty, getIntegerBounds, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, makeElaborator, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, prepareForStreaming, process, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplifyChildren, staticTypeCheck, supportsLazyEvaluation, suppressValidation, typeCheckChildren, typeError, verifyParentPointers, withLocationMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.trace.TraceablegatherProperties
- 
Constructor Details- 
SingletonIntersectExpressionSpecial case of an intersect expression where the first argument is a singleton- Parameters:
- p1- the first argument, always a singleton
- op- the operator, always Token.INTERSECT
- p2- the second argument
 
 
- 
- 
Method Details- 
simplifySimplify the expression- Overrides:
- simplifyin class- VennExpression
- Returns:
- the simplified expression (or the original if unchanged, or if modified in-situ)
- Throws:
- XPathException- if an error is discovered during expression rewriting
 
- 
optimizepublic Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException Perform optimisation of an expression and its subexpressions.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. - Overrides:
- optimizein class- VennExpression
- Parameters:
- visitor- an expression visitor
- contextItemType- 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 original expression, rewritten if appropriate to optimize execution
- Throws:
- XPathException- if an error is discovered during this phase (typically a type error)
 
- 
copyCopy an expression. This makes a deep copy.- Overrides:
- copyin class- VennExpression
- Parameters:
- rebindings- variables that need to be re-bound
- Returns:
- the copy of the original expression
 
- 
iterateIterate over the value of the expression. The result will always be sorted in document order, with duplicates eliminated- Overrides:
- iteratein class- VennExpression
- Parameters:
- c- The context for evaluation
- Returns:
- a SequenceIterator representing the union of the two operands
- Throws:
- XPathException- if any dynamic error occurs evaluating the expression
 
- 
effectiveBooleanValueGet the effective boolean value. In the case of a union expression, this is reduced to an OR expression, for efficiency- Overrides:
- effectiveBooleanValuein class- VennExpression
- Parameters:
- c- The context in which the expression is to be evaluated
- Returns:
- the effective boolean value
- Throws:
- XPathException- if any dynamic error occurs evaluating the expression
 
- 
containsNodeAsk whether the sequence supplied in the first argument contains the node supplied in the second- Parameters:
- iter- an iterator over nodes. The iterator will be closed if the node is found.
- m- the node to be tested
- Returns:
- true if (and only if) the sequence contains the node
- Throws:
- XPathException- if evaluating the iterator fails
 
- 
getExpressionNameDescription copied from class:VennExpressionGet a name identifying the kind of expression, in terms meaningful to a user.- Overrides:
- getExpressionNamein class- VennExpression
- Returns:
- a name identifying the kind of expression, in terms meaningful to a user. The name will always be in the form of a lexical XML QName, and should match the name used in explain() output displaying the expression.
 
- 
displayOperatorDisplay the operator used by this binary expression- Overrides:
- displayOperatorin class- BinaryExpression
- Returns:
- String representation of the operator (for diagnostic display only)
 
- 
tagGet the element name used to identify this expression in exported expression format- Overrides:
- tagin class- VennExpression
- Returns:
- the element name used to identify this expression
 
- 
getElaboratorMake an elaborator for this expression- Overrides:
- getElaboratorin class- VennExpression
- Returns:
- a suitable elaborator
 
 
-