Package net.sf.saxon.pattern
Class IntersectPattern
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.PseudoExpression
net.sf.saxon.pattern.Pattern
net.sf.saxon.pattern.VennPattern
net.sf.saxon.pattern.IntersectPattern
- All Implemented Interfaces:
ExportAgent,Locatable,IdentityComparable,Traceable
A pattern formed as the difference of two other patterns
-
Field Summary
Fields inherited from class net.sf.saxon.pattern.VennPattern
p1, p2Fields inherited from class net.sf.saxon.expr.Expression
EFFECTIVE_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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intHashcode supporting equals()Convert the pattern to a typed pattern, in which an element name is treated as schema-element(N)copy(RebindingMap rebindings) Copy a pattern.booleanDetermine whether this pattern is the same as another patterndoubleThe default priority of an "intersect" pattern is the priority of the LH operandGet an ItemType that all the items matching this pattern must satisfyprotected StringGet the relevant operator: "union", "intersect", or "except"getUType()Get a UType indicating which kinds of items this Pattern can match.booleanmatches(Item item, XPathContext context) Determine if the supplied node matches the patternbooleanmatchesBeneathAnchor(NodeInfo node, NodeInfo anchor, XPathContext context) Determine whether this pattern matches a given Node within the subtree rooted at a given anchor node.Methods inherited from class net.sf.saxon.pattern.VennPattern
allocateSlots, bindCurrent, export, gatherComponentPatterns, getDependencies, getLHS, getRHS, isMotionless, matchesCurrentGroup, operands, reconstruct, simplify, typeCheckMethods inherited from class net.sf.saxon.pattern.Pattern
effectiveBooleanValue, getElaborator, getFingerprint, getHostLanguage, getOriginalText, handleDynamicError, isLiftable, isRecoverable, make, matchesItem, optimize, patternContainsVariable, replaceCurrent, selectNodes, setOriginalText, setPriority, setRecoverable, toPattern, toShortString, toStringMethods inherited from class net.sf.saxon.expr.PseudoExpression
computeCardinality, evaluateAsString, evaluateItem, getImplementationMethod, iterate, processMethods inherited from class net.sf.saxon.expr.Expression
addToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeSpecialProperties, computeStaticProperties, dispatchTailCall, dynamicError, explain, getCardinality, getConfiguration, getCost, getEvaluationMethod, getExpressionName, getExtraProperty, getIntegerBounds, 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, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, makeElaborator, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, prepareForStreaming, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplifyChildren, staticTypeCheck, supportsLazyEvaluation, suppressValidation, typeCheckChildren, typeError, unordered, verifyParentPointers, withLocationMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.trace.Traceable
gatherProperties
-
Constructor Details
-
IntersectPattern
Constructor- Parameters:
p1- the left-hand operandp2- the right-hand operand
-
-
Method Details
-
getItemType
Get an ItemType that all the items matching this pattern must satisfy- Specified by:
getItemTypein classPattern- Returns:
- an ItemType, as specific as possible, which all the matching items satisfy
-
getUType
Get a UType indicating which kinds of items this Pattern can match. -
getDefaultPriority
public double getDefaultPriority()The default priority of an "intersect" pattern is the priority of the LH operand- Overrides:
getDefaultPriorityin classPattern- Returns:
- the priority of the LH operand
-
matches
Determine if the supplied node matches the pattern- Specified by:
matchesin classPattern- Parameters:
item- the node to be comparedcontext- The dynamic context.- Returns:
- true if the node matches either of the operand patterns
- Throws:
XPathException- if an error occurs while matching the pattern
-
matchesBeneathAnchor
public boolean matchesBeneathAnchor(NodeInfo node, NodeInfo anchor, XPathContext context) throws XPathException Determine whether this pattern matches a given Node within the subtree rooted at a given anchor node. This method is used when the pattern is used for streaming.- Overrides:
matchesBeneathAnchorin classPattern- Parameters:
node- The NodeInfo representing the Element or other node to be tested against the Patternanchor- The anchor node, which must match any AnchorPattern subpatterncontext- The dynamic context. Only relevant if the pattern uses variables, or contains calls on functions such as document() or key().- Returns:
- true if the node matches the Pattern, false otherwise
- Throws:
XPathException- if an error occurs while matching the pattern (the caller will usually treat this the same as a false result)
-
convertToTypedPattern
Convert the pattern to a typed pattern, in which an element name is treated as schema-element(N)- Overrides:
convertToTypedPatternin classPattern- Parameters:
val- either "strict" or "lax" depending on the value of xsl:mode/@typed- Returns:
- either the original pattern unchanged, or a new pattern as the result of the conversion
- Throws:
XPathException- if the pattern cannot be converted
-
equals
Determine whether this pattern is the same as another pattern- Overrides:
equalsin classVennPattern- Parameters:
other- the other object- Returns:
- true if the other operand is an expression and if it can be determined that the two expressions are equivalent, in the sense that they will always return the same result.
-
computeHashCode
protected int computeHashCode()Hashcode supporting equals()- Overrides:
computeHashCodein classVennPattern- Returns:
- a computed hash code
-
getOperatorName
Get the relevant operator: "union", "intersect", or "except"- Specified by:
getOperatorNamein classVennPattern- Returns:
- the operator, as a string
-
copy
Copy a pattern. This makes a deep copy.
-