public final class Context extends Simple
| Modifier and Type | Method and Description |
|---|---|
Expr |
addText(QueryContext ctx)
Optionally adds a text node to an expression for potential index rewriting.
|
Expr |
comp(QueryContext ctx)
Compiles and optimizes the expression, assigns data types and
cardinalities.
|
Item |
item(QueryContext ctx,
InputInfo ii)
Evaluates the expression and returns the resulting item or
a
null reference, if the expression yields an empty sequence. |
Iter |
iter(QueryContext ctx)
Evaluates the expression and returns an iterator on the resulting items.
|
boolean |
removable(Var v)
Checks if the specified variable is replaceable by a context item.
|
boolean |
sameAs(Expr cmp)
Compares the current and specified expression for equality.
|
java.lang.String |
toString() |
boolean |
uses(Expr.Use u)
Indicates if an expression uses the specified type or operation.
|
Value |
value(QueryContext ctx)
Evaluates the expression and returns the resulting value.
|
checkBln, checkColl, checkCreate, checkCtx, checkDbl, checkDBNode, checkEStr, checkEStr, checkIO, checkItem, checkItr, checkItr, checkMap, checkNode, checkNoEmpty, checkStr, checkType, checkUp, checkUp, checkWrite, compBln, ebv, optPre, preEval, size, test, typecompEbv, hasFreeVars, indexAccessible, indexEquivalent, isEmpty, isFunction, isItem, isVacuous, isValue, iterable, markTailCallsdescription, infopublic Context(InputInfo ii)
ii - input infopublic Expr comp(QueryContext ctx)
Exprpublic Iter iter(QueryContext ctx) throws QueryException
ExprExpr.item(org.basex.query.QueryContext, org.basex.util.InputInfo) must be implemented
by an expression, as it may be called by this method.iter in class ParseExprctx - query contextQueryException - query exceptionpublic Value value(QueryContext ctx) throws QueryException
Exprvalue in class ParseExprctx - query contextQueryException - query exceptionpublic Item item(QueryContext ctx, InputInfo ii) throws QueryException
Exprnull reference, if the expression yields an empty sequence.
If this method is not overwritten, Expr.iter(org.basex.query.QueryContext) must be implemented
by an expression, as it may be called by this method.item in class ParseExprctx - query contextii - input infoQueryException - query exceptionpublic boolean removable(Var v)
ExprPreds.removable(org.basex.query.util.Var), if one of the variables is used within
a predicate.MixedPath.removable(org.basex.query.util.Var), if the variable occurs within
the path.Group.removable(org.basex.query.util.Var), as the group by expression depends on
variable references.GFLWOR.comp(org.basex.query.QueryContext) to rewrite where clauses
into predicates.public Expr addText(QueryContext ctx)
Exprpublic boolean uses(Expr.Use u)
ExprExpr.comp(org.basex.query.QueryContext) methods to test the properties of sub-expressions.
It will return true as soon as at least one test is successful.public boolean sameAs(Expr cmp)
Expr