Package org.basex.query.value.seq
Class DBNodeSeq
java.lang.Object
org.basex.query.expr.ExprInfo
org.basex.query.expr.Expr
org.basex.query.value.Value
org.basex.query.value.seq.Seq
org.basex.query.value.seq.DBNodeSeq
- Direct Known Subclasses:
DBNodes
Sequence, containing at least two nodes in distinct document order (DDO).
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanPre values reference all documents of the database.protected final DataData reference.protected int[]Pre values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanall()Indicates if pre values reference all documents of the database.final longatomSize()Computes the number of atomized items.atomValue(QueryContext qc, InputInfo ii) Evaluates the expression and returns the atomized items.final voidCaches lazy values.data()Returns the data reference bound to this expression.booleanddo()Indicates if this expression returns nodes in document order without duplicates.ebv(QueryContext qc, InputInfo ii) Checks if the effective boolean value can be computed for this expression:booleanThis function is e.g.static ValueCreates a sequence with the specified items.static ValueCreates a sequence with the specified items.static ValueCreates a node sequence with the given data reference and pre values.final Valueinsert(long pos, Item item, QueryContext qc) Inserts an item at the given position into this sequence and returns the resulting sequence.itemAt(long pos) Returns the item at the given position in the value.voidplan(QueryString qs) Creates a query string.intpre(int index) Returns the specified pre value.int[]pres()Returns the internal pre value array.final Valueremove(long pos, QueryContext qc) Removes the item at the given position in this sequence and returns the resulting sequence.reverse(QueryContext qc) Returns all items of this value in reverse order.Methods inherited from class org.basex.query.value.seq.Seq
copyInsert, description, get, hash, initialCapacity, insertBefore, item, iter, plan, refineType, seqType, size, subSeq, subsequence, test, toErrorString, toJavaMethods 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, atomItem, atomIter, data, funcType, hasFreeVars, indexAccessible, isSimple, markTailCalls, mergeEbv, optimize, simplifyFor, typeCheck, uses, vacuous, visitAllMethods 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
-
data
Data reference. -
all
protected final boolean allPre values reference all documents of the database. -
pres
protected int[] presPre values.
-
-
Constructor Details
-
DBNodeSeq
Constructor.- Parameters:
pres- pre valuesdata- data referencetype- node typeall- pre values reference all documents of the database
-
-
Method Details
-
data
Description copied from class:Expr -
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.
- Parameters:
qc- query contextii- input info (required forSeqinstances, which have no input info)- Returns:
- item
- If it yields an empty sequence,
-
ddo
public boolean ddo()Description copied from class:ExprIndicates if this expression returns nodes in document order without duplicates. -
itemAt
Description copied from class:ValueReturns the item at the given position in the value. The specified value must be lie within the valid bounds. -
atomValue
Description copied from class:ExprEvaluates the expression and returns the atomized items.- Parameters:
qc- query contextii- input info (only required bySeqinstances, which have no input info)- Returns:
- atomized item
-
pres
public int[] pres()Returns the internal pre value array.- Returns:
- pre values
-
pre
public int pre(int index) Returns the specified pre value.- Parameters:
index- index of pre value- Returns:
- pre value
-
all
public boolean all()Indicates if pre values reference all documents of the database.- Returns:
- flag
-
reverse
Description copied from class:ValueReturns all items of this value in reverse order. -
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.
-
plan
Description copied from class:ExprInfoCreates a query string. -
get
Creates a sequence with the specified items.- Parameters:
pres- pre valuesdata- data referencetype- node type (can benull)all- pre values reference all documents of the database- Returns:
- value
-
get
Creates a sequence with the specified items.- Parameters:
pres- pre valuesdata- data referenceexpr- expression (can benull)- Returns:
- value
-
get
Creates a node sequence with the given data reference and pre values.- Parameters:
pres- pre valuesdata- data referencedocs- all values reference document nodesall- pre values reference all documents of the database- Returns:
- value
-
cache
Description copied from class:ValueCaches lazy values. -
atomSize
public final long atomSize()Description copied from class:ValueComputes the number of atomized items. -
insert
Inserts an item at the given position into this sequence and returns the resulting sequence. Because this function will mostly be invoked recursively, the standard implementation will be called, because its runtime outweighs the possibly higher memory consumption. -
remove
Removes the item at the given position in this sequence and returns the resulting sequence. Because this function will mostly be invoked recursively, the standard implementation will be called, because its runtime outweighs the possibly higher memory consumption.
-