Package org.basex.query.func.fn
Class FnEmpty
- java.lang.Object
-
- org.basex.query.expr.ExprInfo
-
- org.basex.query.expr.Expr
-
- org.basex.query.expr.ParseExpr
-
- org.basex.query.expr.Arr
-
- org.basex.query.func.StandardFunc
-
- org.basex.query.func.fn.FnEmpty
-
- Direct Known Subclasses:
FnExists
public class FnEmpty extends StandardFunc
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 FnEmpty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bln
item(QueryContext qc, InputInfo ii)
Evaluates the expression and returns the resulting item, orEmpty.VALUE
if the expression yields an empty sequence.Expr
mergeEbv(Expr expr, boolean or, CompileContext cc)
Tries to merge two expressions that are part of an EBV test.protected Expr
opt(CompileContext cc)
Performs function-specific optimizations.protected void
simplifyArgs(CompileContext cc)
Simplifies the types of all arguments.-
Methods inherited from class org.basex.query.func.StandardFunc
arity, checkPerm, coerce, coerce, compileData, copy, dataLock, defined, description, embed, equals, has, hasCTX, hasUPD, hofIndex, optFirst, optFirst, optimize, refineFunc, serialize, toBaseUri, toBindings, toBoolean, toCollation, toCollation, toContent, toContent, toData, toDate, toDBNode, toEncodingOrNull, toEncodingOrNull, toFunction, toFunction, toFunctionOrNull, toIO, toIO, toMs, toName, toNodeOrAtomItem, toOptions, toOptions, toPath, toPath, toStr, toString, toXml, toZeroStr, vacuous, variadic
-
Methods inherited from class org.basex.query.expr.Arr
accept, allAreValues, arg, args, checkUp, compile, copyAll, count, exprSize, flatten, inline, inlineable, mayBePositional, removeEmpty, simplifyAll
-
Methods inherited from class org.basex.query.expr.ParseExpr
adoptType, atomValue, checkAllUp, checkNoneUp, checkNoUp, checkType, checkType, checkUp, copyType, ctxValue, data, info, iter, 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, value
-
Methods inherited from class org.basex.query.expr.Expr
arg, atomItem, atomIter, ddo, funcType, hasFreeVars, indexAccessible, info, isSimple, markTailCalls, optimizePos, simplify, simplifyFor, typeCheck, uses, visitAll
-
Methods inherited from class org.basex.query.expr.ExprInfo
toErrorString, toString
-
-
-
-
Method Detail
-
item
public Bln 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
-
simplifyArgs
protected final 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
-
opt
protected final Expr opt(CompileContext cc) throws QueryException
Description copied from class:StandardFunc
Performs function-specific optimizations.- Overrides:
opt
in classStandardFunc
- Parameters:
cc
- compilation context- Returns:
- optimized or original expression
- Throws:
QueryException
- query exception
-
mergeEbv
public final Expr mergeEbv(Expr expr, boolean or, CompileContext cc) throws QueryException
Description copied from class:Expr
Tries to merge two expressions that are part of an EBV test. Called byAnd
,Or
),Step
andFilter
. Overwritten byCmpG
,CmpIR
,CmpR
,CmpSR
,IntPos
,SimplePos
and others.- Overrides:
mergeEbv
in classExpr
- Parameters:
expr
- second expressionor
- union or intersectioncc
- compilation context- Returns:
- optimized expression or
null
- Throws:
QueryException
- query exception
-
-