public final class FnBoolean extends StandardFunc
sc, sig
Constructor and Description |
---|
FnBoolean() |
Modifier and Type | Method and Description |
---|---|
Item |
item(QueryContext qc,
InputInfo ii)
Evaluates the expression and returns the resulting item,
or a
null reference if the expression yields an empty sequence. |
protected Expr |
opt(QueryContext qc,
VarScope scp)
Performs function specific optimizations.
|
Expr |
optimizeEbv(QueryContext qc,
VarScope scp)
|
arg, cache, checkAdmin, checkArity, checkCreate, checkData, checkPath, compile, copy, dataLock, dateTimeToMs, description, has, isFunction, isVacuous, oneOf, optimize, plan, sameAs, serialize, toBindings, toCollation, toDBNode, toEncoding, toOptions, toPath, toString
accept, allAreValues, checkUp, copyAll, count, exprSize, inline, oneIsEmpty, removable, toString
atomItem, atomValue, checkAtomic, checkNoEmpty, checkNoEmpty, checkNoneUp, checkNoUp, checkType, compBln, copyType, ctxValue, ebv, iter, optPre, optPre, preEval, seqType, seqType, size, test, toArray, toArray, toAtomItem, toB64, toB64, toBin, toBin, toBoolean, toBoolean, toBytes, toBytes, toDouble, toDouble, toElem, toEmptyNode, toEmptyToken, toFloat, toFunc, toItem, toLong, toLong, toMap, toMap, toNode, toNode, toNumber, toQNm, toQNm, toToken, toToken, value
atomIter, data, hasFreeVars, indexAccessible, inlineAll, isEmpty, isValue, iterable, markTailCalls, typeCheck, uses, visitAll
public Item item(QueryContext qc, InputInfo ii) throws QueryException
Expr
null
reference if the expression yields an empty sequence.
If this method is not overwritten, Expr.iter(QueryContext)
must be implemented by an
expression, as it may be called by this method.item
in class ParseExpr
qc
- query contextii
- input infonull
QueryException
- query exceptionprotected Expr opt(QueryContext qc, VarScope scp) throws QueryException
StandardFunc
opt
in class StandardFunc
qc
- query contextscp
- variable scopeQueryException
- query exceptionpublic Expr optimizeEbv(QueryContext qc, VarScope scp)
Expr
This method is e.g. overwritten by expressions like CmpG
, CmpV
,
FnBoolean
, FnExists
, Path
or Filter
.
It is called at compile time by expressions that perform
effective boolean value tests (e.g. If
or Preds
).
If the arguments of the called expression return a boolean anyway,
the expression will be simplified.
Example in CmpV
:
if($x eq true())
is rewritten to if($x)
if $x
is known to return a single boolean.
optimizeEbv
in class Expr
qc
- query contextscp
- variable scopeCopyright © 2005–2015 BaseX Team. All rights reserved.