Package org.basex.query.value.seq
Class ItemSeq
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.ItemSeq
Flat item sequence.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionlongatomSize()Computes the number of atomized items.atomValue(QueryContext qc, InputInfo ii) Evaluates the expression and returns the atomized items.voidCaches lazy values.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 typed sequence with the items of the specified values.static ValueCreates a typed sequence with the items of the specified values.insert(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.remove(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, ddo, description, get, hash, initialCapacity, insertBefore, item, iter, plan, 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, 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
-
Method Details
-
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.
- Specified by:
ebvin classExpr- Parameters:
qc- query contextii- input info (required forSeqinstances, which have no input info)- Returns:
- item
- Throws:
QueryException- query exception
- If it yields an empty sequence,
-
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.- Specified by:
atomValuein classExpr- Parameters:
qc- query contextii- input info (only required bySeqinstances, which have no input info)- Returns:
- atomized item
- Throws:
QueryException- query exception
-
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.
-
insert
Description copied from class:SeqInserts an item at the given position into this sequence and returns the resulting sequence. -
remove
Description copied from class:SeqRemoves the item at the given position in this sequence and returns the resulting sequence. -
cache
Description copied from class:ValueCaches lazy values.- Specified by:
cachein classValue- Parameters:
lazy- lazy cachingii- input info- Throws:
QueryException- query exception
-
atomSize
public long atomSize()Description copied from class:ValueComputes the number of atomized items. -
get
Creates a typed sequence with the items of the specified values.- Parameters:
size- size of resulting sequencevalues- valuestype- type (can benull, only considered if new sequence is created)- Returns:
- value
-
get
Creates a typed sequence with the items of the specified values.- Parameters:
size- size of resulting sequencevalues- valuesexpr- expression (can benull, only considered if new sequence is created)- Returns:
- value
-