public final class Array extends FItem
Modifier and Type | Method and Description |
---|---|
QNm |
argName(int pos)
Name of the argument at the given position.
|
int |
arity()
Number of arguments this function takes.
|
int |
arraySize()
Number of members contained in this array.
|
Item |
atomItem(InputInfo ii)
Evaluates the expression and returns the atomized items.
|
long |
atomSize()
Computes the number of atomized items.
|
Value |
atomValue(InputInfo ii)
Evaluates the expression and returns the atomized items.
|
FItem |
coerceTo(FuncType ft,
QueryContext qc,
InputInfo ii,
boolean opt)
Coerces this function item to the given function type.
|
boolean |
deep(Item item,
InputInfo ii,
Collation coll)
Performs a deep comparison of two items.
|
String |
description()
Returns a string description of the expression.
|
QNm |
funcName()
Name of this function,
null means anonymous function. |
FuncType |
funcType()
Type of this function.
|
static Array |
get(Array array,
int start,
int size)
Factory method for subarrays.
|
Value |
get(int index)
Returns the member at the specified index.
|
Value |
get(Item key,
InputInfo ii)
Gets the value from this array.
|
static Array |
get(Value... members)
Returns an instance of this class.
|
boolean |
hasType(ArrayType t)
Checks if the array has the given type.
|
Expr |
inlineExpr(Expr[] exprs,
QueryContext qc,
VarScope scp,
InputInfo ii)
Tries to inline this function with the given argument expressions.
|
Item |
invItem(QueryContext qc,
InputInfo ii,
Value... args)
Internally invokes this function with the given arguments.
|
Value |
invValue(QueryContext qc,
InputInfo ii,
Value... args)
Internally invokes this function with the given arguments.
|
Array |
materialize(InputInfo ii)
Materializes streamable values, or returns a self reference.
|
ArrayIterator<Value> |
members()
Returns a member iterator.
|
void |
plan(FElem plan)
Creates an expression tree.
|
byte[] |
serialize(InputInfo ii)
Returns a string representation of the array.
|
int |
stackFrameSize()
Size of this function's stack frame.
|
void |
string(TokenBuilder tb,
InputInfo ii)
Returns a string representation of the array.
|
Object |
toJava()
Returns a Java representation of the value.
|
String |
toString() |
annotations, eq, has, invokeItem, invokeValue, string
atomItem, bool, comparable, dbl, dec, diff, ebv, equiv, flt, hash, homogeneous, input, item, itemAt, iter, iterable, itr, score, score, seqType, size, test, typeId, writeTo, xdmInfo
accept, atomValue, cache, checkUp, compile, copy, count, exprSize, inline, isValue, iter, iterator, removable, serialize, serialize, value
atomIter, data, hasFreeVars, indexAccessible, inlineAll, isEmpty, isFunction, isVacuous, markTailCalls, optimize, optimizeEbv, sameAs, typeCheck, uses, visitAll
public static final Array EMPTY
public static Array get(Value... members)
members
- valuespublic static Array get(Array array, int start, int size)
array
- input arraystart
- start index (starting from 0}size
- number of memberspublic Value invValue(QueryContext qc, InputInfo ii, Value... args) throws QueryException
XQFunction
XQFunction.invokeValue(QueryContext, InputInfo, Value...)
instead.qc
- query contextii
- input infoargs
- argumentsQueryException
- query exceptionpublic Item invItem(QueryContext qc, InputInfo ii, Value... args) throws QueryException
XQFunction
XQFunction.invokeItem(QueryContext, InputInfo, Value...)
instead.qc
- query contextii
- input infoargs
- argumentsQueryException
- query exceptionpublic Value get(Item key, InputInfo ii) throws QueryException
key
- key to look for (must be an integer)ii
- input info()
otherwiseQueryException
- query exceptionpublic int stackFrameSize()
XQFunction
public int arity()
XQFunctionExpr
public QNm funcName()
XQFunctionExpr
null
means anonymous function.null
public QNm argName(int pos)
XQFunctionExpr
pos
- position of the argumentpublic FuncType funcType()
XQFunctionExpr
public Expr inlineExpr(Expr[] exprs, QueryContext qc, VarScope scp, InputInfo ii)
XQFunctionExpr
exprs
- argument expressionsqc
- query contextscp
- variable scopeii
- input infonull
otherwisepublic ArrayIterator<Value> members()
public Value get(int index)
index
- indexpublic int arraySize()
public Array materialize(InputInfo ii) throws QueryException
Value
materialize
in class Item
ii
- input infoQueryException
- query exceptionpublic Value atomValue(InputInfo ii) throws QueryException
Value
atomValue
in class Item
ii
- input infoQueryException
- query exceptionpublic Item atomItem(InputInfo ii) throws QueryException
Item
atomItem
in class FItem
ii
- input infoQueryException
- query exceptionpublic long atomSize()
Value
public byte[] serialize(InputInfo ii) throws QueryException
ii
- input infoQueryException
- query exceptionpublic void string(TokenBuilder tb, InputInfo ii) throws QueryException
tb
- token builderii
- input infoQueryException
- query exceptionpublic boolean hasType(ArrayType t)
t
- typetrue
if the type fits, false
otherwisepublic FItem coerceTo(FuncType ft, QueryContext qc, InputInfo ii, boolean opt) throws QueryException
FItem
coerceTo
in class FItem
ft
- function typeqc
- query contextii
- input infoopt
- if the result should be optimizedQueryException
- query exceptionpublic boolean deep(Item item, InputInfo ii, Collation coll) throws QueryException
FItem
deep
in class FItem
item
- item to be comparedii
- input infocoll
- collationQueryException
- query exceptionpublic String description()
ExprInfo
ExprInfo.toString()
method,
arguments are not included in the output.description
in class Item
public void plan(FElem plan)
ExprInfo
public Object toJava() throws QueryException
Value
toJava
in class Value
QueryException
- query exceptionCopyright © 2005–2015 BaseX Team. All rights reserved.