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:
java.io.Serializable
,javax.xml.transform.SourceLocator
,LocationProvider
,SaxonLocator
,InstructionInfo
,org.xml.sax.Locator
public class SingletonIntersectExpression extends VennExpression
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.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.expr.BinaryExpression
operand0, operand1, operator
-
Fields inherited from class net.sf.saxon.expr.Expression
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, PUSH_SELECTION, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, WATCH_METHOD
-
-
Constructor Summary
Constructors Constructor Description SingletonIntersectExpression(Expression p1, int op, Expression p2)
Special case of an intersect expression where the first argument is a singleton
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expression
copy()
Copy an expression.protected java.lang.String
displayOperator()
Display the operator used by this binary expressionboolean
effectiveBooleanValue(XPathContext c)
Get the effective boolean value.java.lang.String
getExpressionName()
Get a name identifying the kind of expression, in terms meaningful to a user.SequenceIterator
iterate(XPathContext c)
Iterate over the value of the expression.-
Methods inherited from class net.sf.saxon.expr.VennExpression
computeCardinality, computeSpecialProperties, equals, gatherComponents, getItemType, hashCode, optimize, simplify, typeCheck
-
Methods inherited from class net.sf.saxon.expr.BinaryExpression
explain, explainExtraAttributes, getArguments, getOperands, getOperator, isAssociative, isCommutative, isInverse, iterateSubExpressions, promote, replaceSubExpression, setFlattened, toString
-
Methods inherited from class net.sf.saxon.expr.Expression
addToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getHostLanguage, getImplementationMethod, getIntegerBounds, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, hasVariableBinding, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setLocationId, staticTypeCheck, suppressValidation, typeError
-
-
-
-
Constructor Detail
-
SingletonIntersectExpression
public SingletonIntersectExpression(Expression p1, int op, Expression p2)
Special case of an intersect expression where the first argument is a singleton- Parameters:
p1
- the first argument, always a singletonop
- the operator, always Token.INTERSECTp2
- the second argument
-
-
Method Detail
-
copy
public Expression copy()
Copy an expression. This makes a deep copy.- Overrides:
copy
in classVennExpression
- Returns:
- the copy of the original expression
-
iterate
public SequenceIterator iterate(XPathContext c) throws XPathException
Iterate over the value of the expression. The result will always be sorted in document order, with duplicates eliminated- Overrides:
iterate
in classVennExpression
- 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
-
effectiveBooleanValue
public boolean effectiveBooleanValue(XPathContext c) throws XPathException
Get the effective boolean value. In the case of a union expression, this is reduced to an OR expression, for efficiency- Overrides:
effectiveBooleanValue
in classVennExpression
- 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
-
getExpressionName
public java.lang.String getExpressionName()
Description copied from class:VennExpression
Get a name identifying the kind of expression, in terms meaningful to a user.- Overrides:
getExpressionName
in classVennExpression
- 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.
-
displayOperator
protected java.lang.String displayOperator()
Display the operator used by this binary expression- Overrides:
displayOperator
in classBinaryExpression
- Returns:
- String representation of the operator (for diagnostic display only)
-
-