|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.data.ExprInfo
org.basex.query.expr.Expr
org.basex.query.expr.ParseExpr
org.basex.query.expr.Arr
org.basex.query.func.StandardFunc
public abstract class StandardFunc
Standard (built-in) functions.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.basex.query.expr.Expr |
---|
Expr.Flag |
Field Summary |
---|
Fields inherited from class org.basex.query.expr.Arr |
---|
expr |
Fields inherited from class org.basex.query.expr.ParseExpr |
---|
info, size, type |
Constructor Summary | |
---|---|
protected |
StandardFunc(InputInfo ii,
Function s,
Expr... args)
Constructor. |
Method Summary | |
---|---|
static Item |
atom(Item it,
InputInfo ii)
Atomizes the specified item. |
protected java.util.HashMap<java.lang.String,Value> |
bindings(int i,
QueryContext ctx)
Returns all keys and values of the specified binding argument. |
protected void |
cache(Iter ir,
ValueBuilder vb,
QueryContext ctx)
Caches and materializes all items of the specified iterator. |
protected Data |
checkData(QueryContext ctx)
Returns a data instance for the first string argument of the function. |
protected java.io.File |
checkFile(int i,
QueryContext ctx)
Converts the specified argument to a file instance. |
Expr |
compile(QueryContext ctx,
VarScope scp)
Compiles and optimizes the expression, assigns data types and cardinalities. |
StandardFunc |
copy(QueryContext ctx,
VarScope scp,
IntObjMap<Var> vs)
Copies an expression. |
protected boolean |
dataLock(ASTVisitor visitor)
Checks if the specified database can be detected for locking, i.e., if the first argument of the tested function is a static string. |
protected long |
dateTimeToMs(Expr e,
QueryContext ctx)
Converts the specified dateTime to milliseconds. |
java.lang.String |
description()
Returns a string description of the expression. |
protected java.lang.String |
encoding(int i,
Err err,
QueryContext ctx)
Returns a normalized encoding representation. |
boolean |
has(Expr.Flag flag)
Indicates if an expression has the specified compiler property. |
boolean |
isFunction(Function f)
Checks if this expression is a certain function. |
boolean |
isVacuous()
Tests if this is a vacuous expression (empty sequence or error function). |
protected static boolean |
oneOf(Function sig,
Function... sigs)
Compares several signatures for equality. |
protected Expr |
opt(QueryContext ctx)
Performs function specific optimizations. |
Expr |
optimize(QueryContext ctx,
VarScope scp)
Optimizes an already compiled expression without recompiling its sub-expressions. |
void |
plan(FElem plan)
Creates an expression tree. |
java.lang.String |
toString()
|
Methods inherited from class org.basex.query.expr.Arr |
---|
accept, allAreValues, checkNoUp, checkUp, copyAll, count, exprSize, indexEquivalent, inline, removable, toString |
Methods inherited from class org.basex.query.expr.ParseExpr |
---|
checkAdmin, checkAllUp, checkBinary, checkBln, checkColl, checkCreate, checkCtx, checkDbl, checkDBNode, checkEStr, checkEStr, checkFunc, checkItem, checkItr, checkItr, checkMap, checkNode, checkNode, checkNode, checkNoEmpty, checkNoneUp, checkNoUp, checkQNm, checkStr, checkStr, checkStrBin, checkType, checkWrite, compBln, copyType, ebv, item, iter, optPre, preEval, size, test, type, value |
Methods inherited from class org.basex.query.expr.Expr |
---|
addText, compEbv, copy, hasFreeVars, indexAccessible, inlineAll, isEmpty, isItem, isValue, iterable, markTailCalls, sameAs, uses, visitAll |
Methods inherited from class org.basex.data.ExprInfo |
---|
addPlan, addPlan, info, planAttr, planElem |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected StandardFunc(InputInfo ii, Function s, Expr... args)
ii
- input infos
- function definitionargs
- argumentsMethod Detail |
---|
public final Expr compile(QueryContext ctx, VarScope scp) throws QueryException
Expr
compile
in class Arr
ctx
- query contextscp
- variable scope
QueryException
- query exceptionpublic final Expr optimize(QueryContext ctx, VarScope scp) throws QueryException
Expr
optimize
in class Expr
ctx
- query contextscp
- variable scope
QueryException
- query exceptionprotected Expr opt(QueryContext ctx) throws QueryException
ctx
- query context
QueryException
- query exceptionpublic final StandardFunc copy(QueryContext ctx, VarScope scp, IntObjMap<Var> vs)
Expr
copy
in class Expr
ctx
- query contextscp
- variable scope for creating new variablesvs
- mapping from old variable IDs to new variable copies
public static final Item atom(Item it, InputInfo ii) throws QueryException
it
- input itemii
- input info
QueryException
- query exceptionpublic boolean has(Expr.Flag flag)
Expr
Expr.compile(org.basex.query.QueryContext, org.basex.query.var.VarScope)
methods to test properties of sub-expressions.
It returns true
if at least one test is successful.
has
in class Arr
flag
- flag to be found
public final boolean isFunction(Function f)
Expr
isFunction
in class Expr
f
- function definition
public final boolean isVacuous()
Expr
isVacuous
in class Expr
public final java.lang.String description()
ExprInfo
ExprInfo.toString()
method,
arguments are not included in the output.
description
in class ExprInfo
public final void plan(FElem plan)
ExprInfo
plan
in class Arr
plan
- root elementpublic final java.lang.String toString()
toString
in class ExprInfo
protected final Data checkData(QueryContext ctx) throws QueryException
ctx
- query context
QueryException
- query exceptionprotected java.io.File checkFile(int i, QueryContext ctx) throws QueryException
i
- argument indexctx
- query context
QueryException
- query exceptionprotected final boolean dataLock(ASTVisitor visitor)
visitor
- visitor
protected final java.lang.String encoding(int i, Err err, QueryContext ctx) throws QueryException
i
- index of encoding argumenterr
- error for invalid encodingctx
- query context
QueryException
- query exceptionprotected final long dateTimeToMs(Expr e, QueryContext ctx) throws QueryException
e
- expressionctx
- query context
QueryException
- query exceptionprotected final java.util.HashMap<java.lang.String,Value> bindings(int i, QueryContext ctx) throws QueryException
i
- index of argumentctx
- query context
QueryException
- query exceptionprotected final void cache(Iter ir, ValueBuilder vb, QueryContext ctx) throws QueryException
ir
- iteratorvb
- value builderctx
- query context
QueryException
- query exceptionprotected static boolean oneOf(Function sig, Function... sigs)
sig
- signature to be foundsigs
- signatures to be compared
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |