public final class IndexedFilterExpression extends 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 and Description |
---|
IndexedFilterExpression(Expression base,
Expression use,
Expression search,
AtomicComparer comparer,
boolean convertUntypedToOther) |
IndexedFilterExpression(VariableReference start,
ComparisonExpression filter,
boolean indexFirstOperand)
Constructor
|
Modifier and Type | Method and Description |
---|---|
PathMap.PathMapNodeSet |
addToPathMap(PathMap pathMap,
PathMap.PathMapNodeSet pathMapNodeSet)
Add a representation of this expression to a PathMap.
|
int |
computeCardinality()
Get the static cardinality of this expression
|
int |
computeDependencies()
Determine which aspects of the context the expression depends on.
|
int |
computeHashCode()
get HashCode for comparing two expressions
|
int |
computeSpecialProperties()
Get the static properties of this expression (other than its type).
|
Expression |
copy(RebindingMap rebindings)
Copy an expression.
|
boolean |
equals(java.lang.Object other)
Is this expression the same as another expression?
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
Expression |
getBaseExpression()
Get the underlying expression
|
AtomicComparer |
getComparer()
Get the comparer used for the comparisons
|
java.lang.String |
getExpressionName()
Get a name identifying the kind of expression, in terms meaningful to a user.
|
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
ItemType |
getItemType()
Get the data type of the items returned
|
Expression |
getSearchExpression()
Get the expression whose value we will be searching for
|
Expression |
getUseExpression()
Get the expression to be indexed
|
boolean |
isConvertUntypedToOther()
Ask whether untyped atomic values need to be converted to the type of the other operand
|
SequenceIterator<?> |
iterate(XPathContext context)
Iterate over the results, returning them in the correct order
|
java.lang.Iterable<Operand> |
operands()
Get the immediate sub-expressions of this expression, with information about the relationship
of each expression to its parent expression.
|
Expression |
optimize(ExpressionVisitor visitor,
ContextItemStaticInfo contextItemType)
Perform optimisation of an expression and its subexpressions.
|
java.lang.String |
toShortString()
Produce a short string identifying the expression for use in error messages
|
Expression |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Type-check the expression
|
adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeStaticProperties, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getExtraProperty, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, getStreamerName, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, prepareForStreaming, process, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toString, typeCheckChildren, typeError, unordered, verifyParentPointers
public IndexedFilterExpression(VariableReference start, ComparisonExpression filter, boolean indexFirstOperand)
start
- Variable containing the sequence of items from which the selection will take place.filter
- An expression defining the filter predicateindexFirstOperand
- true if the first operand of the filter comparison is to be indexed, false
if the second operand is to be indexedpublic IndexedFilterExpression(Expression base, Expression use, Expression search, AtomicComparer comparer, boolean convertUntypedToOther)
public java.lang.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 ItemType getItemType()
getItemType
in class Expression
public Expression getBaseExpression()
public Expression getUseExpression()
public Expression getSearchExpression()
public boolean isConvertUntypedToOther()
public AtomicComparer getComparer()
public Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
typeCheck
in class Expression
visitor
- an expression visitorcontextInfo
- information about the static type of the context itemXPathException
- if an error is discovered during this phase
(typically a type error)public Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException
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.
optimize
in class Expression
visitor
- an expression visitorcontextItemType
- 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
XPathException
- if an error is discovered during this phase
(typically a type error)public int getImplementationMethod()
getImplementationMethod
in class Expression
Expression.ITERATE_METHOD
or Expression.EVALUATE_METHOD
or
Expression.PROCESS_METHOD
public Expression copy(RebindingMap rebindings)
copy
in class Expression
rebindings
- variables that need to be re-boundpublic int computeCardinality()
computeCardinality
in class Expression
public int computeSpecialProperties()
computeSpecialProperties
in class Expression
public PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
addToPathMap
in class Expression
pathMap
- the PathMap to which the expression should be addedpathMapNodeSet
- the PathMapNodeSet to which the paths embodied in this expression should be addedpublic boolean equals(java.lang.Object other)
equals
in class Expression
other
- the expression to be compared with this onepublic int computeHashCode()
computeHashCode
in class Expression
public SequenceIterator<?> iterate(XPathContext context) throws XPathException
iterate
in class Expression
context
- the dynamic context for the evaluationXPathException
- if any dynamic error occurspublic int computeDependencies()
computeDependencies
in class Expression
public java.lang.String getExpressionName()
getExpressionName
in class Expression
public void export(ExpressionPresenter out) throws XPathException
export
in interface ExportAgent
export
in class Expression
out
- the expression presenter used to display the structureXPathException
- if the export fails, for example if an expression is found that won't work
in the target environment.public java.lang.String toShortString()
Expression
toShortString
in class Expression
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.