|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.expr.Expression com.saxonica.extra.IndexedLookupExpression
public final class IndexedLookupExpression
An IndexedLookupExpression contains a base expression and a lookup expression. The base expression will always be a local variable reference. The expression returns true if the base expression (after atomization) contains the value of the lookup expression. That is, the expression is equivalent to exists(base[lookup]), except that lookup is evaluated with the same context as base.
Field Summary |
---|
Fields inherited from class net.sf.saxon.expr.Expression |
---|
EVALUATE_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, staticProperties |
Constructor Summary | |
---|---|
IndexedLookupExpression(VariableReference base,
Expression lookup,
AtomicComparer comparer)
Constructor |
Method Summary | |
---|---|
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 |
effectiveBooleanValue(XPathContext context)
Get the effective boolean value of the expression. |
boolean |
equals(Object other)
Is this expression the same as another expression? |
Item |
evaluateItem(XPathContext context)
Evaluate an expression as a single item. |
void |
explain(ExpressionPresenter destination)
Diagnostic print of expression structure. |
AtomicComparer |
getAtomicComparer()
Get the atomic comparer used |
Expression |
getBaseExpression()
Get the underlying expression |
ItemType |
getItemType(TypeHierarchy th)
Get the data type of the items returned |
Expression |
getLookup()
Get the lookup expression |
Expression |
getLookupExpression()
Get the expression to be searched |
int |
hashCode()
get HashCode for comparing two expressions |
Iterator<Expression> |
iterateSubExpressions()
Get the immediate subexpressions of this expression |
Expression |
optimize(ExpressionVisitor visitor,
ItemType contextItemType)
Perform optimisation of an expression and its subexpressions. |
Expression |
promote(PromotionOffer offer,
Expression parent)
Promote this expression if possible |
boolean |
replaceSubExpression(Expression original,
Expression replacement)
Replace one subexpression by a replacement subexpression |
Expression |
simplify(ExpressionVisitor visitor)
Simplify an expression |
Expression |
typeCheck(ExpressionVisitor visitor,
ItemType contextItemType)
Type-check the expression |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IndexedLookupExpression(VariableReference base, Expression lookup, AtomicComparer comparer)
base
- A sequence expression denoting the sequence to be searchedlookup
- An expression defining value to be soughtMethod Detail |
---|
public ItemType getItemType(TypeHierarchy th)
getItemType
in class Expression
th
- the type hierarchy cache
public Expression getBaseExpression()
public Expression getLookup()
public Expression getLookupExpression()
public AtomicComparer getAtomicComparer()
public Expression simplify(ExpressionVisitor visitor) throws XPathException
simplify
in class Expression
visitor
- an expression visitor
XPathException
- if an error is discovered during expression
rewritingpublic Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType)
typeCheck
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
public Expression optimize(ExpressionVisitor visitor, ItemType 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 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
public Expression copy()
copy
in class Expression
public Expression promote(PromotionOffer offer, Expression parent) throws XPathException
promote
in class Expression
offer
- details of the promotion that is possibleparent
-
XPathException
- if any error is detectedpublic Iterator<Expression> iterateSubExpressions()
iterateSubExpressions
in class Expression
public boolean replaceSubExpression(Expression original, Expression replacement)
replaceSubExpression
in class Expression
original
- the original subexpressionreplacement
- the replacement subexpression
public int computeCardinality()
computeCardinality
in class Expression
public int computeSpecialProperties()
computeSpecialProperties
in class Expression
public boolean equals(Object other)
equals
in class Object
other
- the expression to be compared with this one
public int hashCode()
hashCode
in class Object
public boolean effectiveBooleanValue(XPathContext context) throws XPathException
Expression
effectiveBooleanValue
in class Expression
context
- The context in which the expression is to be evaluated
XPathException
- if any dynamic error occurs evaluating the
expressionpublic Item evaluateItem(XPathContext context) throws XPathException
Expression
evaluateItem
in interface EvaluableItem
evaluateItem
in class Expression
context
- The context in which the expression is to be evaluated
XPathException
- if any dynamic error occurs evaluating the
expressionpublic int computeDependencies()
computeDependencies
in class Expression
public void explain(ExpressionPresenter destination)
explain
in class Expression
destination
- the expression presenter used to display the structure
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |