public abstract class VennPattern extends Pattern
Modifier and Type | Field and Description |
---|---|
protected Pattern |
p1 |
protected Pattern |
p2 |
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD
Constructor and Description |
---|
VennPattern(Pattern p1,
Pattern p2)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
allocateSlots(SlotManager slotManager,
int nextFree)
Allocate slots to any variables used within the pattern
|
void |
bindCurrent(LocalBinding binding)
Replace any calls on current() by a variable reference bound to the supplied binding
|
boolean |
equals(Object other)
Determine whether this pattern is the same as another pattern
|
void |
export(ExpressionPresenter presenter)
Diagnostic print of expression structure.
|
void |
gatherComponentPatterns(Set<Pattern> set)
Gather the component (non-Venn) patterns of this Venn pattern
|
int |
getDependencies()
Get the dependencies of the pattern.
|
Pattern |
getLHS()
Get the LHS of the union
|
protected abstract String |
getOperatorName()
Get the relevant operator: "union", "intersect", or "except"
|
Pattern |
getRHS()
Get the RHS of the union
|
int |
hashCode()
Hashcode supporting equals()
|
boolean |
isMotionless(boolean allowExtensions)
Test whether a pattern is motionless, that is, whether it can be evaluated against a node
without repositioning the input stream.
|
Iterator<Expression> |
iterateSubExpressions()
Iterate over the subexpressions within this pattern
|
Iterable<Operand> |
operands()
Get the immediate sub-expressions of this expression, with information about the relationship
of each expression to its parent expression.
|
void |
promote(PromotionOffer offer,
Expression parent)
Offer promotion for subexpressions within this pattern.
|
void |
setOriginalText(String pattern)
Set the original text
|
Pattern |
simplify()
Simplify the pattern: perform any context-independent optimisations
|
String |
toString()
Get the original pattern text
|
Pattern |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextItemType)
Type-check the pattern.
|
convertToTypedPattern, copy, effectiveBooleanValue, getDefaultPriority, getFingerprint, getHostLanguage, getItemType, getUType, make, matches, matchesBeneathAnchor, optimize, replaceCurrent, selectNodes, setPriority
computeCardinality, evaluateAsString, evaluateItem, getImplementationMethod, iterate, iterateEvents, process
addToPathMap, adoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, clearStreamabilityData, computeDependencies, computeSpecialProperties, computeStaticProperties, doPromotion, dynamicError, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getEvaluationMethod, getExpressionCompiler, getExpressionName, getIntegerBounds, getIntrinsicDependencies, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getPosture, getPostureAndSweepIfKnown, getProperties, getProperty, getRetainedStaticContext, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStreamability, getStreamingAdjunct, getSweep, getSystemId, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, makeStreamingAdjunct, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, optimizeForType, promote, promoteChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setFiltered, setFlattened, setLocation, setParentExpression, setPostureAndSweep, setRetainedStaticContext, setRetainedStaticContextLocally, setStaticProperty, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toShortString, toStreamingPattern, typeCheckChildren, typeError, unordered
public Iterable<Operand> operands()
If the expression is a Callable, then it is required that the order of the operands returned by this function is the same as the order of arguments supplied to the corresponding call() method.
operands
in class Expression
public Pattern simplify() throws XPathException
simplify
in class Pattern
XPathException
- if an error is discovered during expression
rewritingpublic Pattern typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException
typeCheck
in class Pattern
visitor
- the expression visitorcontextItemType
- the type of the context item at the point where the pattern
is defined. Set to null if it is known that the context item is undefined.XPathException
- if an error is discovered during this phase
(typically a type error)public void bindCurrent(LocalBinding binding)
bindCurrent
in class Pattern
public void promote(PromotionOffer offer, Expression parent) throws XPathException
Unlike the corresponding method on Expression
, this method does not return anything:
it can make internal changes to the pattern, but cannot return a different pattern. Only certain
kinds of promotion are applicable within a pattern: specifically, promotions affecting local
variable references within the pattern.
promote
in class Pattern
offer
- details of the offer, for example the offer to move
expressions that don't depend on the context to an outer level in
the containing expressionparent
- the parent expressionXPathException
- if any error is detectedpublic void setOriginalText(String pattern)
setOriginalText
in class Pattern
pattern
- the original text of the patternpublic boolean isMotionless(boolean allowExtensions)
isMotionless
in class Pattern
allowExtensions
- true if Saxon extensions are allowedpublic int allocateSlots(SlotManager slotManager, int nextFree)
allocateSlots
in class Pattern
slotManager
- represents the stack frame on which slots are allocatednextFree
- the next slot that is free to be allocated @return the next slot that is free to be allocatedpublic void gatherComponentPatterns(Set<Pattern> set)
set
- the set into which the components will be addedpublic int getDependencies()
getDependencies
in class Pattern
public Iterator<Expression> iterateSubExpressions()
iterateSubExpressions
in class Pattern
public Pattern getLHS()
public Pattern getRHS()
public boolean equals(Object other)
protected abstract String getOperatorName()
public String toString()
public void export(ExpressionPresenter presenter)
Expression
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.