|
||||||||||
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.value.Value
org.basex.query.value.item.Item
org.basex.query.value.item.FItem
org.basex.query.value.item.FuncItem
public final class FuncItem
Function item.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.basex.query.expr.Expr |
---|
Expr.Flag |
Field Summary | |
---|---|
StaticFunc |
func
Original function. |
Fields inherited from class org.basex.query.value.item.Item |
---|
score, UNDEF |
Fields inherited from class org.basex.query.value.Value |
---|
type |
Constructor Summary | |
---|---|
FuncItem(QNm n,
Var[] arg,
Expr body,
FuncType t,
boolean cst,
java.util.Map<Var,Value> cls,
VarScope scp,
StaticContext sctx,
StaticFunc sf)
Constructor. |
|
FuncItem(QNm n,
Var[] arg,
Expr body,
FuncType t,
boolean cst,
Value vl,
long ps,
long sz,
java.util.Map<Var,Value> cls,
VarScope scp,
StaticContext sctx,
StaticFunc sf)
Constructor. |
|
FuncItem(QNm n,
Var[] arg,
Expr body,
FuncType t,
VarScope scp,
StaticContext sctx,
StaticFunc sf)
Constructor. |
|
FuncItem(Var[] arg,
Expr body,
FuncType t,
java.util.Map<Var,Value> cl,
boolean cst,
VarScope scp,
StaticContext sctx)
Constructor for anonymous functions. |
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. |
int |
arity()
Number of arguments this function takes. |
FItem |
coerceTo(FuncType ft,
QueryContext ctx,
InputInfo ii)
Coerces this function item to the given function type. |
void |
compile(QueryContext ctx)
Compiles the expression contained in this scope. |
boolean |
compiled()
Checks if this scope has already been compiled. |
QNm |
fName()
Name of this function, null means anonymous function. |
FuncType |
funcType()
Type of this function. |
Item |
invItem(QueryContext ctx,
InputInfo ii,
Value... args)
Invokes this function with the given arguments. |
Value |
invValue(QueryContext ctx,
InputInfo ii,
Value... args)
Invokes this function with the given arguments. |
void |
plan(FElem plan)
Creates an expression tree. |
java.lang.String |
toString()
|
boolean |
visit(ASTVisitor visitor)
Traverses this scope with the given ASTVisitor . |
Methods inherited from class org.basex.query.value.item.FItem |
---|
eq, string, toJava |
Methods inherited from class org.basex.query.value.item.Item |
---|
bool, castErr, comparable, dbl, dec, description, diff, ebv, equiv, flt, hash, homogeneous, input, isItem, item, itemAt, iter, iterable, itr, materialize, score, score, size, test, type, typeId, writeTo, xdmInfo |
Methods inherited from class org.basex.query.value.Value |
---|
cache, checkUp, compile, copy, count, data, exprSize, has, inline, isValue, iter, iterator, removable, serialize, value |
Methods inherited from class org.basex.query.expr.Expr |
---|
addText, compEbv, copy, hasFreeVars, indexAccessible, indexEquivalent, inlineAll, isEmpty, isFunction, isVacuous, markTailCalls, optimize, sameAs, uses, visitAll |
Methods inherited from class org.basex.data.ExprInfo |
---|
addPlan, addPlan, info, planAttr, planElem |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final StaticFunc func
Constructor Detail |
---|
public FuncItem(QNm n, Var[] arg, Expr body, FuncType t, VarScope scp, StaticContext sctx, StaticFunc sf)
n
- function namearg
- function argumentsbody
- function bodyt
- function typescp
- variable scopesctx
- static contextsf
- original functionpublic FuncItem(QNm n, Var[] arg, Expr body, FuncType t, boolean cst, java.util.Map<Var,Value> cls, VarScope scp, StaticContext sctx, StaticFunc sf)
n
- function namearg
- function argumentsbody
- function bodyt
- function typecst
- cast flagcls
- closurescp
- variable scopesctx
- static contextsf
- original functionpublic FuncItem(Var[] arg, Expr body, FuncType t, java.util.Map<Var,Value> cl, boolean cst, VarScope scp, StaticContext sctx)
arg
- function argumentsbody
- function bodyt
- function typecl
- variables in the closurecst
- cast flagscp
- variable scopesctx
- static contextpublic FuncItem(QNm n, Var[] arg, Expr body, FuncType t, boolean cst, Value vl, long ps, long sz, java.util.Map<Var,Value> cls, VarScope scp, StaticContext sctx, StaticFunc sf)
n
- function namearg
- function argumentsbody
- function bodyt
- function typecst
- cast flagvl
- context valueps
- context positionsz
- context sizecls
- closurescp
- variable scopesctx
- static contextsf
- original functionMethod Detail |
---|
public int arity()
XQFunction
arity
in interface XQFunction
public QNm fName()
XQFunction
null
means anonymous function.
fName
in interface XQFunction
null
public FuncType funcType()
XQFunction
funcType
in interface XQFunction
public Value invValue(QueryContext ctx, InputInfo ii, Value... args) throws QueryException
XQFunction
invValue
in interface XQFunction
ctx
- query contextii
- input infoargs
- arguments
QueryException
- query exceptionpublic Item invItem(QueryContext ctx, InputInfo ii, Value... args) throws QueryException
XQFunction
invItem
in interface XQFunction
invItem
in class FItem
ctx
- query contextii
- input infoargs
- arguments
QueryException
- query exceptionpublic FItem coerceTo(FuncType ft, QueryContext ctx, InputInfo ii) throws QueryException
FItem
coerceTo
in class FItem
ft
- function typectx
- query contextii
- input info
QueryException
- query exceptionpublic void plan(FElem plan)
ExprInfo
plan
in class FItem
plan
- root elementpublic boolean accept(ASTVisitor visitor)
Expr
accept
in class Value
visitor
- visitor
public boolean visit(ASTVisitor visitor)
Scope
ASTVisitor
.
visit
in interface Scope
visitor
- visitor
public void compile(QueryContext ctx) throws QueryException
Scope
compile
in interface Scope
ctx
- query context
QueryException
- compilation errorspublic boolean compiled()
Scope
compiled
in interface Scope
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 |