public final class Map extends FItem
Modifier and Type | Method and Description |
---|---|
Map |
addAll(Map map,
InputInfo ii)
Adds all bindings from the given map into
this . |
ValueBuilder |
apply(FItem func,
QueryContext qc,
InputInfo ii)
Applies a function on all entries.
|
QNm |
argName(int pos)
Name of the argument at the given position.
|
int |
arity()
Number of arguments this function takes.
|
boolean |
checkTz(Item key)
Checks if the specified key has a different timezone than the stored keys.
|
Map |
coerceTo(FuncType ft,
QueryContext qc,
InputInfo ii,
boolean opt)
Coerces this function item to the given function type.
|
boolean |
contains(Item key,
InputInfo ii)
Checks if the given key exists in the map.
|
boolean |
deep(Item item,
InputInfo ii,
Collation coll)
Performs a deep comparison of two items.
|
Map |
delete(Item key,
InputInfo ii)
Deletes a key from this map.
|
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.
|
Value |
get(Item key,
InputInfo ii)
Gets the value from this map.
|
int |
hash(InputInfo ii)
Returns a hash code for this value.
|
boolean |
hasType(MapType mt)
Checks if the map 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.
|
Value |
keys()
All keys defined in this map.
|
int |
mapSize()
Number of values contained in this map.
|
void |
plan(FElem plan)
Creates an expression tree.
|
Map |
put(Item key,
Value value,
InputInfo ii)
Puts the given value into this map and replaces existing keys.
|
byte[] |
serialize(InputInfo ii)
Returns a string representation of the map.
|
int |
stackFrameSize()
Size of this function's stack frame.
|
void |
string(TokenBuilder tb,
int level,
InputInfo ii)
Returns a string representation of the map.
|
HashMap<Object,Object> |
toJava()
Returns a Java representation of the value.
|
String |
toString() |
ValueBuilder |
values()
All values defined in this map.
|
annotations, atomItem, eq, has, invokeItem, invokeValue, string
atomItem, atomSize, atomValue, bool, comparable, dbl, dec, diff, ebv, equiv, flt, homogeneous, input, item, itemAt, iter, iterable, itr, materialize, 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 Map EMPTY
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 int stackFrameSize()
XQFunction
public 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 invValue(QueryContext qc, InputInfo ii, Value... args) throws QueryException
XQFunction
XQFunction.invokeValue(QueryContext, InputInfo, Value...)
instead.qc
- query contextii
- input infoargs
- argumentsQueryException
- query exceptionpublic Map delete(Item key, InputInfo ii) throws QueryException
key
- key to delete (must not be null
)ii
- input infothis
otherwiseQueryException
- query exceptionpublic Value get(Item key, InputInfo ii) throws QueryException
key
- key to look for (must not be null
)ii
- input info()
otherwiseQueryException
- query exceptionpublic boolean contains(Item key, InputInfo ii) throws QueryException
key
- key to look for (must not be null
)ii
- input infotrue()
if the key exists, false()
otherwiseQueryException
- query exceptionpublic Map addAll(Map map, InputInfo ii) throws QueryException
this
.map
- map to addii
- input infothis
otherwiseQueryException
- query exceptionpublic boolean hasType(MapType mt)
mt
- typetrue
if the type fits, false
otherwisepublic Map 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 Map put(Item key, Value value, InputInfo ii) throws QueryException
key
- key to insert (must not be null
)value
- value to insertii
- input infothis
otherwiseQueryException
- query exceptionpublic boolean checkTz(Item key)
key
- key to checkpublic int mapSize()
public Value keys()
public ValueBuilder values()
public ValueBuilder apply(FItem func, QueryContext qc, InputInfo ii) throws QueryException
func
- function to apply on keys and valuesqc
- query contextii
- input infoQueryException
- 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 byte[] serialize(InputInfo ii) throws QueryException
ii
- input infoQueryException
- query exceptionpublic HashMap<Object,Object> toJava() throws QueryException
Value
toJava
in class Value
QueryException
- query exceptionpublic int hash(InputInfo ii) throws QueryException
Value
hash
in class Item
ii
- input infoQueryException
- if atomization can't be applied (e.g. function item)public String description()
ExprInfo
ExprInfo.toString()
method,
arguments are not included in the output.description
in class Item
public void plan(FElem plan)
ExprInfo
public void string(TokenBuilder tb, int level, InputInfo ii) throws QueryException
tb
- token builderlevel
- current levelii
- input infoQueryException
- query exceptionpublic Expr inlineExpr(Expr[] exprs, QueryContext qc, VarScope scp, InputInfo ii)
XQFunctionExpr
exprs
- argument expressionsqc
- query contextscp
- variable scopeii
- input infonull
otherwiseCopyright © 2005–2015 BaseX Team. All rights reserved.