Package org.basex.query.func
Class StaticFunc
java.lang.Object
org.basex.query.expr.ExprInfo
org.basex.query.scope.StaticScope
org.basex.query.scope.StaticDecl
org.basex.query.func.StaticFunc
- All Implemented Interfaces:
XQFunction,XQFunctionExpr,Scope
A static user-defined function.
- Author:
- BaseX Team 2005-21, BSD License, Leo Woerteler
-
Field Summary
FieldsFields inherited from class org.basex.query.scope.StaticDecl
anns, declType, dontEnter, name -
Method Summary
Modifier and TypeMethodDescriptionAnnotations of this function.intarity()Number of arguments this function takes.voidcomp(CompileContext cc) Compiles the expression contained in this scope.Returns a string description of the expression.funcName()Name of this function,nullmeans anonymous function.funcType()Type of this function.byte[]id()Returns a unique identifier for this declaration.static booleaninline(CompileContext cc, AnnList anns, Expr expr) Checks if inlining conditions are given.inline(Expr[] exprs, CompileContext cc) Tries to inline this function with the given arguments.invokeInternal(QueryContext qc, InputInfo ii, Value[] args) Internally invokes this function with the given arguments.voidOptimize the static function.paramName(int pos) Name of the parameter at the given position.voidCreates a query plan.voidplan(QueryString qs) Creates a query string.intSize of this function's stack frame.booleanChecks if this function returns vacuous results (seeExpr.vacuous()).booleanvisit(ASTVisitor visitor) Traverses this scope with the givenASTVisitor.Methods inherited from class org.basex.query.scope.StaticDecl
seqTypeMethods inherited from class org.basex.query.scope.StaticScope
compiled, docMethods inherited from class org.basex.query.expr.ExprInfo
toErrorString, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.basex.query.func.XQFunction
invoke, invokeTail
-
Field Details
-
params
Formal parameters.
-
-
Method Details
-
comp
Description copied from interface:ScopeCompiles the expression contained in this scope. -
optimize
Optimize the static function.- Parameters:
cc- compilation context
-
arity
public int arity()Description copied from interface:XQFunctionExprNumber of arguments this function takes.- Specified by:
arityin interfaceXQFunctionExpr- Returns:
- function arity
-
funcName
Description copied from interface:XQFunctionExprName of this function,nullmeans anonymous function.- Specified by:
funcNamein interfaceXQFunctionExpr- Returns:
- name or
null
-
paramName
Description copied from interface:XQFunctionExprName of the parameter at the given position.- Specified by:
paramNamein interfaceXQFunctionExpr- Parameters:
pos- position of the parameter- Returns:
- name of the parameter
-
funcType
Description copied from interface:XQFunctionExprType of this function.- Specified by:
funcTypein interfaceXQFunctionExpr- Returns:
- this function's type
-
stackFrameSize
public int stackFrameSize()Description copied from interface:XQFunctionSize of this function's stack frame.- Specified by:
stackFrameSizein interfaceXQFunction- Returns:
- stack frame size
-
annotations
Description copied from interface:XQFunctionExprAnnotations of this function.- Specified by:
annotationsin interfaceXQFunctionExpr- Returns:
- this function's annotations
-
invokeInternal
Description copied from interface:XQFunctionInternally invokes this function with the given arguments.- Specified by:
invokeInternalin interfaceXQFunction- Parameters:
qc- query contextii- input infoargs- arguments- Returns:
- resulting value
- Throws:
QueryException- query exception
-
vacuousBody
public boolean vacuousBody()Description copied from interface:XQFunctionExprChecks if this function returns vacuous results (seeExpr.vacuous()).- Specified by:
vacuousBodyin interfaceXQFunctionExpr- Returns:
- result of check
-
visit
Description copied from interface:ScopeTraverses this scope with the givenASTVisitor. -
id
public byte[] id()Description copied from class:StaticDeclReturns a unique identifier for this declaration.- Specified by:
idin classStaticDecl- Returns:
- a byte sequence that uniquely identifies this declaration
-
inline
Description copied from interface:XQFunctionExprTries to inline this function with the given arguments.- Specified by:
inlinein interfaceXQFunctionExpr- Parameters:
exprs- argumentscc- compilation context- Returns:
- the expression to inline if successful,
nullotherwise - Throws:
QueryException- query exception
-
inline
Checks if inlining conditions are given.- Parameters:
cc- compilation contextanns- annotationsexpr- expression- Returns:
- result of check
-
description
Description copied from class:ExprInfoReturns a string description of the expression. This method is only called by error messages. Contrary to theExprInfo.toString()method, arguments are not included in the output.- Overrides:
descriptionin classExprInfo- Returns:
- result of check
-
plan
Description copied from class:ExprInfoCreates a query plan. -
plan
Description copied from class:ExprInfoCreates a query string.
-