Package org.basex.query.value.item
Class FItem
- java.lang.Object
-
- org.basex.query.expr.ExprInfo
-
- org.basex.query.expr.Expr
-
- org.basex.query.value.Value
-
- org.basex.query.value.item.Item
-
- org.basex.query.value.item.FItem
-
- All Implemented Interfaces:
Iterable<Item>
,XQFunction
,XQFunctionExpr
public abstract class FItem extends Item implements XQFunction
- Author:
- BaseX Team 2005-24, BSD License, Leo Woerteler
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
atomicEqual(Item item)
Compares items for atomic equality.FItem
coerceTo(FuncType ft, QueryContext qc, CompileContext cc, InputInfo ii)
Converts this function item to the given function type.boolean
equal(Item item, Collation coll, InputInfo ii)
Compares items for equality.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.FuncType
funcType()
Returns the function type of this expression.Item
materialize(Predicate<Data> test, InputInfo ii, QueryContext qc)
Returns a materialized version of this value without dependencies to persistent data.boolean
materialized(Predicate<Data> test, InputInfo ii)
Checks if this value is materialized, i.e., contains no persistent database nodes or function items.-
Methods inherited from class org.basex.query.value.item.Item
atomItem, atomValue, bool, cache, comparable, compare, dbl, ddo, dec, deepEqual, description, flt, hash, input, instanceOf, isItem, item, itemAt, iter, itr, refineType, refineType, reverse, sameType, score, seqType, size, string, stringInput, subsequence, test, toXml, typeId, write, xdmInfo
-
Methods inherited from class org.basex.query.value.Value
accept, checkUp, compactify, compile, copy, count, exprSize, get, has, inline, inlineable, isEmpty, iter, iterator, refineType, serialize, serialize, serialize, toJava, value
-
Methods inherited from class org.basex.query.expr.Expr
arg, args, atomIter, data, hasFreeVars, indexAccessible, info, isSimple, markTailCalls, mergeEbv, optimize, optimizePos, simplify, simplifyFor, typeCheck, uses, vacuous, visitAll
-
Methods inherited from class org.basex.query.expr.ExprInfo
info, toErrorString, toString, toString
-
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
-
Methods inherited from interface org.basex.query.func.XQFunction
invoke, invokeInternal, invokeTail, stackFrameSize
-
Methods inherited from interface org.basex.query.func.XQFunctionExpr
annotations, arity, funcName, inline, paramName, vacuousBody
-
-
-
-
Constructor Detail
-
FItem
protected FItem(Type type)
Constructor.- Parameters:
type
- function type
-
-
Method Detail
-
equal
public final boolean equal(Item item, Collation coll, InputInfo ii) throws QueryException
Description copied from class:Item
Compares items for equality. Called byCmpV.OpV
.- Specified by:
equal
in classItem
- Parameters:
item
- item to be comparedcoll
- collation (can benull
)ii
- input info (can benull
)- Returns:
- result of check
- Throws:
QueryException
- query exception
-
atomicEqual
public final boolean atomicEqual(Item item)
Description copied from class:Item
Compares items for atomic equality. Called byFnAtomicEqual
.- Overrides:
atomicEqual
in classItem
- Parameters:
item
- item to be compared- Returns:
- result of check
-
funcType
public final FuncType funcType()
Description copied from class:Expr
Returns the function type of this expression.- Specified by:
funcType
in interfaceXQFunctionExpr
- Overrides:
funcType
in classExpr
- Returns:
- function type, or
null
if expression yields no functions
-
materialize
public Item materialize(Predicate<Data> test, InputInfo ii, QueryContext qc) throws QueryException
Description copied from class:Value
Returns a materialized version of this value without dependencies to persistent data. Raises an error if the value contains function items.- Overrides:
materialize
in classItem
- Parameters:
test
- test to check if a node can be adopted unchangedii
- input info (can benull
)qc
- query context- Returns:
- materialized value
- Throws:
QueryException
- query exception
-
materialized
public boolean materialized(Predicate<Data> test, InputInfo ii) throws QueryException
Description copied from class:Value
Checks if this value is materialized, i.e., contains no persistent database nodes or function items.- Overrides:
materialized
in classItem
- Parameters:
test
- test to check if a node can be adopted unchangedii
- input info (can benull
)- Returns:
- result of check
- Throws:
QueryException
- query exception
-
coerceTo
public FItem coerceTo(FuncType ft, QueryContext qc, CompileContext cc, InputInfo ii) throws QueryException
Converts this function item to the given function type.- Parameters:
ft
- function typeqc
- query contextcc
- compilation context (null
during runtime)ii
- input info (can benull
)- Returns:
- coerced item
- Throws:
QueryException
- query exception
-
equals
public final 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.
-
-