|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.data.ExprInfo
org.basex.query.expr.Expr
org.basex.query.expr.ParseExpr
org.basex.query.expr.Simple
org.basex.query.expr.Context
public final class Context
Context item.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.basex.query.expr.Expr |
---|
Expr.Flag |
Field Summary |
---|
Fields inherited from class org.basex.query.expr.ParseExpr |
---|
info, size, type |
Constructor Summary | |
---|---|
Context(InputInfo ii)
Constructor. |
Method Summary | |
---|---|
boolean |
accept(ASTVisitor visitor)
Traverses this expression, notifying the visitor of declared and used variables, and checking the tree for other recursive properties. |
Expr |
addText(QueryContext ctx)
Optionally adds a text node to an expression for potential index rewriting. |
Context |
compile(QueryContext ctx,
VarScope scp)
Compiles and optimizes the expression, assigns data types and cardinalities. |
Expr |
copy(QueryContext ctx,
VarScope scp,
IntObjMap<Var> vs)
Copies an expression. |
boolean |
has(Expr.Flag flag)
Indicates if an expression has the specified compiler property. |
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()
|
Value |
value(QueryContext ctx)
Evaluates the expression and returns the resulting value. |
Methods inherited from class org.basex.query.expr.Simple |
---|
checkUp, count, exprSize, inline, plan |
Methods inherited from class org.basex.query.expr.ParseExpr |
---|
checkAdmin, checkAllUp, checkBinary, checkBln, checkColl, checkCreate, checkCtx, checkDbl, checkDBNode, checkEStr, checkEStr, checkFunc, checkItem, checkItr, checkItr, checkMap, checkNode, checkNode, checkNode, checkNoEmpty, checkNoneUp, checkNoUp, checkQNm, checkStr, checkStr, checkStrBin, checkType, checkWrite, compBln, copyType, ebv, optPre, preEval, size, test, type |
Methods inherited from class org.basex.query.expr.Expr |
---|
compEbv, copy, hasFreeVars, indexAccessible, indexEquivalent, inlineAll, isEmpty, isFunction, isItem, isVacuous, isValue, iterable, markTailCalls, optimize, uses, visitAll |
Methods inherited from class org.basex.data.ExprInfo |
---|
addPlan, addPlan, description, info, planAttr, planElem |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Context(InputInfo ii)
ii
- input infoMethod Detail |
---|
public Context compile(QueryContext ctx, VarScope scp)
Expr
compile
in class Simple
ctx
- query contextscp
- variable scope
public Iter iter(QueryContext ctx) throws QueryException
Expr
Expr.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 ParseExpr
ctx
- query context
QueryException
- query exceptionpublic Value value(QueryContext ctx) throws QueryException
Expr
value
in class ParseExpr
ctx
- query context
QueryException
- query exceptionpublic Item item(QueryContext ctx, InputInfo ii) throws QueryException
Expr
null
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 ParseExpr
ctx
- query contextii
- input info
QueryException
- query exceptionpublic boolean has(Expr.Flag flag)
Expr
Expr.compile(org.basex.query.QueryContext, org.basex.query.var.VarScope)
methods to test properties of sub-expressions.
It returns true
if at least one test is successful.
has
in class Simple
flag
- flag to be found
public boolean removable(Var v)
Expr
Preds.removable(org.basex.query.var.Var)
, if one of the variables is used within a predicate.MixedPath.removable(org.basex.query.var.Var)
, if the variable occurs within the path.GFLWOR.compile(org.basex.query.QueryContext, org.basex.query.var.VarScope)
to rewrite where clauses
into predicates.
removable
in class Simple
v
- variable to be replaced
public Expr copy(QueryContext ctx, VarScope scp, IntObjMap<Var> vs)
Expr
copy
in class Expr
ctx
- query contextscp
- variable scope for creating new variablesvs
- mapping from old variable IDs to new variable copies
public boolean accept(ASTVisitor visitor)
Expr
accept
in class Simple
visitor
- visitor
public Expr addText(QueryContext ctx)
Expr
addText
in class Expr
ctx
- query context
public boolean sameAs(Expr cmp)
Expr
sameAs
in class Expr
cmp
- expression to be compared
public java.lang.String toString()
toString
in class ExprInfo
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |