Package org.basex.query.value.seq
Class RangeSeq
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.RangeSeq
Range sequence, containing at least two integers.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
Fields -
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.Returns a string description of the expression.ebv(QueryContext qc, InputInfo ii) Checks if the effective boolean value can be computed for this expression:booleanThis function is e.g.static Valueget(long start, long size, boolean asc) Returns a value representation of the specified items.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.voidCreates a query plan.voidplan(QueryString qs) Creates a query string.long[]range(boolean order) Returns the range as long values.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.protected SeqsubSeq(long offset, long length, QueryContext qc) Returns a sub sequence of this value with the given start and length.toJava()Returns a Java representation of the value.Methods inherited from class org.basex.query.value.seq.Seq
copyInsert, ddo, get, hash, initialCapacity, insertBefore, item, iter, refineType, seqType, size, subsequence, test, toErrorStringMethods 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
-
Field Details
-
asc
public final boolean ascAscending/descending order.
-
-
Method Details
-
get
Returns a value representation of the specified items.- Parameters:
start- start valuesize- sizeasc- ascending order- Returns:
- resulting item or sequence
-
range
public long[] range(boolean order) Returns the range as long values.- Parameters:
order- respect ascending/descending order- Returns:
- minimum and maximum value (inclusive)
-
toJava
Description copied from class:ValueReturns a Java representation of the value. -
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. -
subSeq
Description copied from class:SeqReturns a sub sequence of this value with the given start and length. -
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. -
reverse
Description copied from class:ValueReturns all items of this value in reverse order. -
cache
Description copied from class:ValueCaches lazy values. -
atomValue
Description copied from class:ExprEvaluates the expression and returns the atomized items. -
atomSize
public long atomSize()Description copied from class:ValueComputes the number of atomized items. -
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 classSeq- Returns:
- result of check
-
plan
Description copied from class:ExprInfoCreates a query plan. -
plan
Description copied from class:ExprInfoCreates a query string.
-