Package org.basex.query.func.fn
Class FnData
-
public final class FnData extends ContextFn
Function implementation.- Author:
- BaseX Team 2005-24, BSD License, Christian Gruen
-
-
Field Summary
-
Fields inherited from class org.basex.query.func.StandardFunc
definition
-
-
Constructor Summary
Constructors Constructor Description FnData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
inlineable()
Indicates if the function will evaluate the current context.Item
item(QueryContext qc, InputInfo ii)
Evaluates the expression and returns the resulting item, orEmpty.VALUE
if the expression yields an empty sequence.Iter
iter(QueryContext qc)
Evaluates the expression and returns an iterator on the resulting items.protected Expr
opt(CompileContext cc)
Performs function-specific optimizations.protected void
simplifyArgs(CompileContext cc)
Simplifies the types of all arguments.Expr
simplifyFor(CompileContext.Simplify mode, CompileContext cc)
Simplifies the expression.Value
value(QueryContext qc)
Evaluates the expression and returns the resulting value.-
Methods inherited from class org.basex.query.func.fn.ContextFn
accept, context, contextAccess, contextIndex, count, hasCTX, inline, simplifyEbv
-
Methods inherited from class org.basex.query.func.StandardFunc
arity, checkPerm, coerceFunc, coerceFunc, compileData, copy, dataLock, defined, description, embed, equals, has, hasUPD, hofIndex, invoke, optFirst, optFirst, optimize, refineFunc, serialize, test, toBaseUri, toBindings, toCollation, toCollation, toContent, toContent, toData, toDate, toDBNode, toEncodingOrNull, toEncodingOrNull, toFunction, toFunction, toFunctionOrNull, toGregorian, toIO, toIO, toMs, toName, toNodeOrAtomItem, toOptions, toOptions, toOptions, toPath, toPath, toSerializerOptions, toStr, toString, toXml, toZeroStr, vacuous
-
Methods inherited from class org.basex.query.expr.Arr
arg, args, checkUp, compile, copyAll, exprSize, flatten, inlineable, mayBePositional, removeEmpty, simplifyAll, values
-
Methods inherited from class org.basex.query.expr.ParseExpr
adoptType, atomValue, checkAllUp, checkNoneUp, checkNoUp, checkType, checkType, checkUp, copyType, ctxValue, data, info, refineType, sc, seqType, size, test, toArray, toArray, toAtomItem, toBin, toBin, toBinOrNull, toBoolean, toBoolean, toBooleanOrFalse, toBytes, toBytes, toDouble, toDouble, toElem, toElem, toEnum, toFloat, toFunction, toLong, toLong, toLong, toMap, toMap, toNode, toNode, toNodeOrNull, toNumber, toNumber, toNumberOrNull, toQNm, toQNmOrNull, toRecord, toString, toString, toStringOrNull, toToken, toToken, toTokenOrNull, toZeroToken
-
Methods inherited from class org.basex.query.expr.Expr
arg, atomItem, atomIter, ddo, funcType, hasFreeVars, indexAccessible, info, isSimple, markTailCalls, mergeEbv, optimizePos, simplify, typeCheck, uses, visitAll
-
Methods inherited from class org.basex.query.expr.ExprInfo
toErrorString, toString
-
-
-
-
Method Detail
-
iter
public Iter iter(QueryContext qc) throws QueryException
Description copied from class:Expr
Evaluates the expression and returns an iterator on the resulting items. The implementation of this method is optional.- Overrides:
iter
in classParseExpr
- Parameters:
qc
- query context- Returns:
- iterator
- Throws:
QueryException
- query exception
-
value
public Value value(QueryContext qc) throws QueryException
Description copied from class:Expr
Evaluates the expression and returns the resulting value. If this method is not implemented,Expr.item(QueryContext, InputInfo)
must be implemented instead.- Overrides:
value
in classParseExpr
- Parameters:
qc
- query context- Returns:
- value
- Throws:
QueryException
- query exception
-
item
public Item item(QueryContext qc, InputInfo ii) throws QueryException
Description copied from class:Expr
Evaluates the expression and returns the resulting item, orEmpty.VALUE
if the expression yields an empty sequence. If this method is not implemented,Expr.value(QueryContext)
must be implemented instead.- Overrides:
item
in classParseExpr
- Parameters:
qc
- query contextii
- input info (can benull
); required for thoseValue
instances that have no input info)- Returns:
- item or
Empty.VALUE
- Throws:
QueryException
- query exception
-
opt
protected Expr opt(CompileContext cc)
Description copied from class:StandardFunc
Performs function-specific optimizations.- Overrides:
opt
in classStandardFunc
- Parameters:
cc
- compilation context- Returns:
- optimized or original expression
-
simplifyArgs
protected void simplifyArgs(CompileContext cc) throws QueryException
Description copied from class:StandardFunc
Simplifies the types of all arguments. This function is overwritten by functions that rely on the original argument type.- Overrides:
simplifyArgs
in classStandardFunc
- Parameters:
cc
- compilation context- Throws:
QueryException
- query exception
-
simplifyFor
public Expr simplifyFor(CompileContext.Simplify mode, CompileContext cc) throws QueryException
Description copied from class:Expr
Simplifies the expression. Overwritten by many expressions; callsExpr.simplify(Simplify, CompileContext)
otherwise.- Overrides:
simplifyFor
in classExpr
- Parameters:
mode
- mode of simplificationcc
- compilation context- Returns:
- simplified or original expression
- Throws:
QueryException
- query exception- See Also:
CompileContext.Simplify
-
inlineable
public boolean inlineable()
Description copied from class:ContextFn
Indicates if the function will evaluate the current context.- Overrides:
inlineable
in classContextFn
- Returns:
- result of check
-
-