Package org.basex.query.value.seq
Class FltSeq
- 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.FltSeq
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Value
atomValue(QueryContext qc, InputInfo ii)
Evaluates the expression and returns the atomized items.void
cache(boolean lazy, InputInfo ii)
Caches data of lazy items (i.e., those implementing theLazy
interface).boolean
equals(Object obj)
This function is e.g. called by:If.optimize(CompileContext)
,Switch.optimize(CompileContext)
,Typeswitch.optimize(CompileContext)
, in order to discard identical expressions.static Value
get(float[] values)
Creates a sequence with the specified values.static Value
get(long size, Value... values)
Creates a typed sequence with the items of the specified values.Value
insertBefore(long pos, Item item, QueryContext qc)
Inserts an item at the given position into this sequence and returns the resulting sequence.Flt
itemAt(long pos)
Returns the item at the given position in the value.static Value
read(DataInput in, Type type, QueryContext qc)
Creates a value from the input stream.void
refineType()
Computes a more precise sequence type of this value.Value
remove(long pos, QueryContext qc)
Removes the item at the given position in this sequence and returns the resulting sequence.Value
reverse(QueryContext qc)
Returns all items of this value in reverse order.boolean
sameType()
Checks if all items of the sequence are of the same type.float[]
toJava()
Returns a Java representation of the value.void
write(DataOutput out)
Writes the data structure to disk.-
Methods inherited from class org.basex.query.value.seq.Seq
copyInsert, ddo, description, initialCapacity, insert, item, iter, materialize, materialized, refineType, seqType, simplifyFor, size, subSeq, subsequence, test, toErrorString, toString, toXml
-
Methods inherited from class org.basex.query.value.Value
accept, checkUp, compactify, compile, copy, count, exprSize, get, has, inline, inlineable, isEmpty, isItem, iter, iterator, refineType, serialize, serialize, serialize, value
-
Methods inherited from class org.basex.query.expr.Expr
arg, args, atomItem, atomIter, data, funcType, hasFreeVars, indexAccessible, info, isSimple, markTailCalls, mergeEbv, optimize, optimizePos, simplify, typeCheck, uses, vacuous, visitAll
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
read
public static Value read(DataInput in, Type type, QueryContext qc) throws IOException, QueryException
Creates a value from the input stream. Called fromStore.read(DataInput, QueryContext)
.- Parameters:
in
- data inputtype
- typeqc
- query context- Returns:
- value
- Throws:
IOException
- I/O exceptionQueryException
- query exception
-
write
public void write(DataOutput out) throws IOException
Description copied from class:Value
Writes the data structure to disk.- Overrides:
write
in classValue
- Parameters:
out
- data output- Throws:
IOException
- I/O exception
-
itemAt
public Flt itemAt(long pos)
Description copied from class:Value
Returns the item at the given position in the value. The specified value must be lie within the valid bounds.
-
reverse
public Value reverse(QueryContext qc)
Description copied from class:Value
Returns all items of this value in reverse order.
-
toJava
public float[] toJava()
Description copied from class:Value
Returns a Java representation of the value.
-
equals
public boolean equals(Object obj)
Description copied from class:Expr
This 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)
, in order to compare the start and end value.PathCache
, in order to find identical root values at runtime.
-
get
public static Value get(float[] values)
Creates a sequence with the specified values.- Parameters:
values
- values- Returns:
- value
-
get
public static Value get(long size, Value... values) throws QueryException
Creates a typed sequence with the items of the specified values.- Parameters:
size
- size of resulting sequencevalues
- values- Returns:
- value
- Throws:
QueryException
- query exception
-
cache
public final void cache(boolean lazy, InputInfo ii)
Description copied from class:Value
Caches data of lazy items (i.e., those implementing theLazy
interface). By calling this method, the streaming feature of lazy items will be disabled.
-
atomValue
public Value atomValue(QueryContext qc, InputInfo ii)
Description copied from class:Expr
Evaluates the expression and returns the atomized items.
-
sameType
public final boolean sameType()
Description copied from class:Value
Checks if all items of the sequence are of the same type.
-
insertBefore
public final Value insertBefore(long pos, Item item, QueryContext qc)
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.- Specified by:
insertBefore
in classSeq
- Parameters:
pos
- position at which the item should be inserted, must be between 0 andSeq.size
item
- item to insertqc
- query context- Returns:
- resulting value
-
remove
public final Value remove(long pos, QueryContext qc)
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.
-
refineType
public void refineType()
Description copied from class:Value
Computes a more precise sequence type of this value.- Overrides:
refineType
in classValue
-
-