Package org.basex.query.value.seq
Class Empty
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.seq.Empty
Empty sequence.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionatomIter(QueryContext qc, InputInfo ii) Evaluates the expression and returns an iterator on the resulting, atomized items.longatomSize()Computes the number of atomized items.Returns a string description of the expression.ebv(QueryContext qc, InputInfo ii) Checks if the effective boolean value can be computed for this expression:booleaneq(Item item, Collation coll, StaticContext sc, InputInfo ii) Compares the items for equality.booleanThis function is e.g.intReturns a hash code for this value.iter()Returns an iterator.voidCreates a query plan.voidplan(QueryString qs) Creates a query string.seqType()Returns the static type of the resulting value.simplifyFor(CompileContext.Simplify mode, CompileContext cc) This function is called at compile time for expressions whose operands might be simplified.longsize()Returns the result size, or-1if the size is unknown.byte[]Returns a string representation of the value.subsequence(long start, long length, QueryContext qc) Returns a subsequence of this value with the given start and length.test(QueryContext qc, InputInfo ii) Performs a predicate test and returns the item if the test was successful.toJava()Returns a Java representation of the value.booleanvacuous()Tests if this is a vacuous expression (empty sequence or error function).Methods inherited from class org.basex.query.value.item.Item
atomItem, atomValue, bool, cache, comparable, dbl, ddo, dec, diff, equiv, flt, input, instanceOf, item, itemAt, itr, materialize, persistent, refineType, reverse, sameKey, score, 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, valueMethods inherited from class org.basex.query.expr.Expr
arg, args, data, data, funcType, hasFreeVars, indexAccessible, isSimple, markTailCalls, mergeEbv, optimize, typeCheck, uses, visitAllMethods inherited from class org.basex.query.expr.ExprInfo
toErrorString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
VALUE
Single instance. -
ITER
Empty iterator.
-
-
Method Details
-
vacuous
public boolean vacuous()Description copied from class:ExprTests if this is a vacuous expression (empty sequence or error function). This check is needed for updating queries. -
size
public long size()Description copied from class:ExprReturns the result size, or-1if the size is unknown. -
toJava
Description copied from class:ValueReturns a Java representation of the value. -
iter
Description copied from class:ValueReturns an iterator. -
ebv
Description copied from class:ExprChecks if the effective boolean value can be computed for this expression:
- If it yields an empty sequence,
Bln.FALSEwill be returned. - If it yields a single item, this item will be returned.
- If it yields nodes, the first node will be returned.
- Otherwise, an error will be raised.
A single numeric item may later be evaluated as positional predicate.
- If it yields an empty sequence,
-
test
Description copied from class:ExprPerforms a predicate test and returns the item if the test was successful. The returned item is required for full-text scoring. -
string
Description copied from class:ItemReturns a string representation of the value. -
eq
Description copied from class:ItemCompares the items for equality. -
subsequence
Description copied from class:ValueReturns a subsequence of this value with the given start and length. The following properties must hold:start >= 0,length >= 0,length <= size() - start
- Overrides:
subsequencein classItem- Parameters:
start- starting positionlength- number of itemsqc- query context- Returns:
- sub sequence
-
seqType
Description copied from class:ExprReturns the static type of the resulting value. -
hash
Description copied from class:ValueReturns a hash code for this value. -
atomIter
Description copied from class:ExprEvaluates the expression and returns an iterator on the resulting, atomized items. -
atomSize
public long atomSize()Description copied from class:ItemComputes the number of atomized items. Overwritten byXQArray. -
simplifyFor
Description copied from class:ExprThis function is called at compile time for expressions whose operands might be simplified.- Overrides:
simplifyForin classExpr- Parameters:
mode- mode of simplificationcc- compilation context- Returns:
- simplified or original expression
- See Also:
-
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.
-
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 classItem- Returns:
- result of check
-
plan
Description copied from class:ExprInfoCreates a query plan. -
plan
Description copied from class:ExprInfoCreates a query string.
-