org.basex.query.value.item
Class FItem

java.lang.Object
  extended by org.basex.data.ExprInfo
      extended by org.basex.query.expr.Expr
          extended by org.basex.query.value.Value
              extended by org.basex.query.value.item.Item
                  extended by org.basex.query.value.item.FItem
All Implemented Interfaces:
java.lang.Iterable<Item>, XQFunction
Direct Known Subclasses:
FuncItem, Map

public abstract class FItem
extends Item
implements XQFunction

Abstract super class for function items.

Author:
BaseX Team 2005-12, BSD License, Leo Woerteler

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.value.item.Item
score, UNDEF
 
Fields inherited from class org.basex.query.value.Value
type
 
Constructor Summary
protected FItem(FuncType t)
          Constructor.
 
Method Summary
abstract  FItem coerceTo(FuncType ft, QueryContext ctx, InputInfo ii)
          Coerces this function item to the given function type.
 boolean eq(Item it, Collation coll, InputInfo ii)
          Checks the items for equality.
 Item invItem(QueryContext ctx, InputInfo ii, Value... args)
          Invokes this function with the given arguments.
abstract  void plan(FElem root)
          Creates an expression tree.
 byte[] string(InputInfo ii)
          Returns a string representation of the value.
 java.lang.Object toJava()
          Returns a Java representation of the value.
 
Methods inherited from class org.basex.query.value.item.Item
bool, castErr, comparable, dbl, dec, description, diff, ebv, equiv, flt, hash, homogeneous, input, isItem, item, itemAt, iter, iterable, itr, materialize, score, score, size, test, type, typeId, writeTo, xdmInfo
 
Methods inherited from class org.basex.query.value.Value
accept, cache, checkUp, compile, copy, count, data, exprSize, has, inline, isValue, iter, iterator, removable, serialize, value
 
Methods inherited from class org.basex.query.expr.Expr
addText, compEbv, copy, hasFreeVars, indexAccessible, indexEquivalent, inlineAll, isEmpty, isFunction, isVacuous, markTailCalls, optimize, sameAs, uses, visitAll
 
Methods inherited from class org.basex.data.ExprInfo
addPlan, addPlan, info, planAttr, planElem, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.basex.query.expr.XQFunction
arity, fName, funcType, invValue
 

Constructor Detail

FItem

protected FItem(FuncType t)
Constructor.

Parameters:
t - type
Method Detail

invItem

public Item invItem(QueryContext ctx,
                    InputInfo ii,
                    Value... args)
             throws QueryException
Description copied from interface: XQFunction
Invokes this function with the given arguments.

Specified by:
invItem in interface XQFunction
Parameters:
ctx - query context
ii - input info
args - arguments
Returns:
resulting item
Throws:
QueryException - query exception

coerceTo

public abstract FItem coerceTo(FuncType ft,
                               QueryContext ctx,
                               InputInfo ii)
                        throws QueryException
Coerces this function item to the given function type.

Parameters:
ft - function type
ctx - query context
ii - input info
Returns:
coerced item
Throws:
QueryException - query exception

string

public final byte[] string(InputInfo ii)
                    throws QueryException
Description copied from class: Item
Returns a string representation of the value.

Specified by:
string in class Item
Parameters:
ii - input info, use null if none is available
Returns:
string value
Throws:
QueryException - if the item can't be atomized

eq

public final boolean eq(Item it,
                        Collation coll,
                        InputInfo ii)
                 throws QueryException
Description copied from class: Item
Checks the items for equality.

Specified by:
eq in class Item
Parameters:
it - item to be compared
coll - collation
ii - input info
Returns:
result of check
Throws:
QueryException - query exception

toJava

public java.lang.Object toJava()
                        throws QueryException
Description copied from class: Value
Returns a Java representation of the value.

Specified by:
toJava in class Value
Returns:
Java object
Throws:
QueryException - query exception

plan

public abstract void plan(FElem root)
Description copied from class: ExprInfo
Creates an expression tree.

Overrides:
plan in class Item
Parameters:
root - root element