Package org.basex.query.value.item
Class XQData
java.lang.Object
org.basex.query.expr.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.XQData
- All Implemented Interfaces:
Iterable<Item>,XQFunction,XQFunctionExpr
Function item with a known data structure (map, array).
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intarity()Number of arguments this function takes.final FItemcoerceTo(FuncType ft, QueryContext qc, InputInfo ii, boolean optimize) Coerces this function item to the given function type.final booleanThis function is e.g.final QNmfuncName()Name of this function,nullmeans anonymous function.abstract ValueGets a value from this item.final Exprinline(Expr[] exprs, CompileContext cc) Tries to inline this function with the given arguments.final ValueinvokeInternal(QueryContext qc, InputInfo ii, Value[] args) Internally invokes this function with the given arguments.final intSize of this function's stack frame.abstract voidstring(boolean indent, TokenBuilder tb, int level, InputInfo ii) Returns a string representation of the item.final booleanChecks if this function returns vacuous results (seeExpr.vacuous()).Methods inherited from class org.basex.query.value.item.FItem
annotations, deep, eq, funcType, refineType, sameKey, stringMethods inherited from class org.basex.query.value.item.Item
atomItem, atomSize, atomValue, bool, cache, comparable, dbl, ddo, dec, description, diff, ebv, equiv, flt, hash, input, instanceOf, item, itemAt, iter, itr, materialize, persistent, plan, reverse, score, seqType, size, subsequence, test, typeId, xdmInfoMethods inherited from class org.basex.query.value.Value
accept, checkUp, compile, copy, count, exprSize, has, inline, inlineable, isEmpty, isItem, iter, iterator, materialize, serialize, serialize, serialize, toJava, valueMethods inherited from class org.basex.query.expr.Expr
arg, args, atomIter, data, data, hasFreeVars, indexAccessible, isSimple, markTailCalls, mergeEbv, optimize, simplifyFor, typeCheck, uses, vacuous, visitAllMethods inherited from class org.basex.query.expr.ExprInfo
plan, toErrorString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.basex.query.func.XQFunction
invoke, invokeTailMethods inherited from interface org.basex.query.func.XQFunctionExpr
paramName
-
Constructor Details
-
XQData
Constructor.- Parameters:
type- type
-
-
Method Details
-
arity
public final int arity()Description copied from interface:XQFunctionExprNumber of arguments this function takes.- Returns:
- function arity
-
funcName
Description copied from interface:XQFunctionExprName of this function,nullmeans anonymous function.- Returns:
- name or
null
-
inline
Description copied from interface:XQFunctionExprTries to inline this function with the given arguments.- Parameters:
exprs- argumentscc- compilation context- Returns:
- the expression to inline if successful,
nullotherwise
-
vacuousBody
public final boolean vacuousBody()Description copied from interface:XQFunctionExprChecks if this function returns vacuous results (seeExpr.vacuous()).- Returns:
- result of check
-
invokeInternal
public final Value invokeInternal(QueryContext qc, InputInfo ii, Value[] args) throws QueryException Description copied from interface:XQFunctionInternally invokes this function with the given arguments.- Parameters:
qc- query contextii- input infoargs- arguments- Returns:
- resulting value
- Throws:
QueryException- query exception
-
stackFrameSize
public final int stackFrameSize()Description copied from interface:XQFunctionSize of this function's stack frame.- Returns:
- stack frame size
-
coerceTo
public final FItem coerceTo(FuncType ft, QueryContext qc, InputInfo ii, boolean optimize) throws QueryException Description copied from class:FItemCoerces this function item to the given function type.- Specified by:
coerceToin classFItem- Parameters:
ft- function typeqc- query contextii- input infooptimize- optimize resulting item- Returns:
- coerced item
- Throws:
QueryException- query exception
-
get
Gets a value from this item.- Parameters:
key- key to look for (must not benull)ii- input info- Returns:
- bound value if found, the empty sequence
()otherwise - Throws:
QueryException- query exception
-
string
public abstract void string(boolean indent, TokenBuilder tb, int level, InputInfo ii) throws QueryException Returns a string representation of the item.- Parameters:
indent- indent outputtb- token builderlevel- current levelii- input info- Throws:
QueryException- query exception
-
equals
Description copied from class:ExprThis function is e.g. called by:If.optimize(CompileContext),Switch.optimize(CompileContext),Typeswitch.optimize(CompileContext), in order to discard identical expressions.CmpR.mergeEbv(Expr, boolean, CompileContext)orCmpSR.mergeEbv(Expr, boolean, CompileContext), in order to merge expressions with identical input.CmpG.optimize(CompileContext)orCmpV.optimize(CompileContext), in order to pre-evaluate equality tests.CmpG.optimize(CompileContext)orPos.get(Expr, CmpV.OpV, InputInfo, CompileContext), in order to compare the start and end value.PathCache, in order to find identical root values at runtime.
-