public final class IndexedFilterExpression extends BinaryExpression implements ContextSwitchingExpression
operatorEFFECTIVE_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 |
|---|
IndexedFilterExpression(VariableReference start,
ComparisonExpression filter,
boolean indexFirstOperand)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
computeCardinality()
Get the static cardinality of this expression
|
int |
computeDependencies()
Determine which aspects of the context the expression depends on.
|
int |
computeSpecialProperties()
Get the static properties of this expression (other than its type).
|
Expression |
copy()
Copy an expression.
|
boolean |
equals(Object other)
Is this expression the same as another expression?
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
Expression |
getActionExpression()
Get the subexpression that is evaluated in the new context
|
VariableReference |
getBaseExpression()
Get the underlying expression
|
ExpressionCompiler |
getExpressionCompiler()
Return the compiler of the IndexedFilter expression
|
ComparisonExpression |
getFilter()
Get the filter expression
|
ItemType |
getItemType()
Get the data type of the items returned
|
protected OperandRole |
getOperandRole(int arg)
Get the operand role
|
Expression |
getSearchExpression()
Get the expression whose value we will be searching for
|
Expression |
getSelectExpression()
Get the subexpression that sets the context item
|
VariableReference |
getStart() |
Expression |
getUseExpression()
Get the expression to be indexed
|
int |
hashCode()
get HashCode for comparing two expressions
|
SequenceIterator |
iterate(XPathContext context)
Iterate over the results, returning them in the correct order
|
Expression |
optimize(ExpressionVisitor visitor,
ContextItemStaticInfo contextItemType)
Perform optimisation of an expression and its subexpressions.
|
Expression |
promote(PromotionOffer offer)
Promote this expression if possible
|
void |
setFilter(ComparisonExpression filter) |
void |
setStart(VariableReference start) |
String |
toShortString()
Produce a short string identifying the expression for use in error messages
|
String |
toString()
Represent the expression as a string.
|
Expression |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Type-check the expression
|
displayOperator, explainExtraAttributes, getImplementationMethod, getLhs, getLhsExpression, getOperator, getRhs, getRhsExpression, isAssociative, isCommutative, isInverse, operands, setFlattened, setLhsExpression, setRhsExpression, tagaddToPathMap, adoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, clearStreamabilityData, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getExpressionName, getHostLanguage, 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, iterateEvents, makeStreamingAdjunct, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, optimizeForType, process, promoteChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setFiltered, setLocation, setParentExpression, setPostureAndSweep, setRetainedStaticContext, setRetainedStaticContextLocally, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toStreamingPattern, typeCheckChildren, typeError, unorderedpublic 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 indexedprotected OperandRole getOperandRole(int arg)
BinaryExpressiongetOperandRole in class BinaryExpressionarg - which argument: 0 for the lhs, 1 for the rhspublic ItemType getItemType()
getItemType in class Expressionpublic VariableReference getBaseExpression()
public ComparisonExpression getFilter()
public Expression getSelectExpression()
getSelectExpression in interface ContextSwitchingExpressionpublic Expression getActionExpression()
getActionExpression in interface ContextSwitchingExpressionpublic Expression getUseExpression()
public Expression getSearchExpression()
public Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
typeCheck in class BinaryExpressionvisitor - 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)
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 BinaryExpressionvisitor - 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_TYPEpublic Expression copy()
copy in class Expressionpublic Expression promote(PromotionOffer offer) throws XPathException
promote in class Expressionoffer - details of the promotion that is possibleXPathException - if any error is detectedpublic int computeCardinality()
computeCardinality in class BinaryExpressionpublic int computeSpecialProperties()
computeSpecialProperties in class BinaryExpressionpublic boolean equals(Object other)
equals in class BinaryExpressionother - the expression to be compared with this onepublic int hashCode()
hashCode in class BinaryExpressionpublic SequenceIterator iterate(XPathContext context) throws XPathException
iterate in class Expressioncontext - the dynamic context for the evaluationXPathException - if any dynamic error occurspublic int computeDependencies()
computeDependencies in class Expressionpublic ExpressionCompiler getExpressionCompiler()
getExpressionCompiler in class Expressionpublic void export(ExpressionPresenter out)
export in class BinaryExpressionout - the output destination for the displayed expression treepublic VariableReference getStart()
public void setStart(VariableReference start)
public void setFilter(ComparisonExpression filter)
public String toString()
BinaryExpressiontoString in class BinaryExpressionpublic String toShortString()
ExpressiontoShortString in class BinaryExpressionCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.