org.basex.query.xquery.util
Class Functions

java.lang.Object
  extended by org.basex.query.ExprInfo
      extended by org.basex.query.xquery.util.Functions

public final class Functions
extends ExprInfo

Global expression context.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Christian Gruen

Constructor Summary
Functions()
           
 
Method Summary
 int add(Func fun)
          Adds a local function.
 void check()
          Checks if all functions have been correctly initialized.
 void comp(XQContext ctx)
          Compiles the functions.
 void funError(QNm name)
          Finds similar function names and throws an error message.
 Func get(int id)
          Returns the function with the specified id.
 Expr get(QNm name, Expr[] args)
          Returns the specified function.
 void plan(Serializer ser)
          Recursively sends the abstract syntax of this expression to the specified serializer.
 java.lang.String toString()
           
static void typeErr(QNm type)
          Throws an error for the specified name.
 
Methods inherited from class org.basex.query.ExprInfo
color, info, name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Functions

public Functions()
Method Detail

get

public Func get(int id)
Returns the function with the specified id.

Parameters:
id - function id
Returns:
function

get

public Expr get(QNm name,
                Expr[] args)
         throws XQException
Returns the specified function.

Parameters:
name - name of the function
args - optional arguments
Returns:
function instance
Throws:
XQException - evaluation exception

typeErr

public static void typeErr(QNm type)
                    throws XQException
Throws an error for the specified name.

Parameters:
type - type as string
Throws:
XQException - query exception

add

public int add(Func fun)
        throws XQException
Adds a local function.

Parameters:
fun - function instance
Returns:
function id
Throws:
XQException - evaluation exception

comp

public void comp(XQContext ctx)
          throws XQException
Compiles the functions.

Parameters:
ctx - xquery context
Throws:
XQException - xquery exception

check

public void check()
           throws XQException
Checks if all functions have been correctly initialized.

Throws:
XQException - xquery exception

funError

public void funError(QNm name)
              throws XQException
Finds similar function names and throws an error message.

Parameters:
name - function name
Throws:
XQException - xquery exception

plan

public void plan(Serializer ser)
          throws java.io.IOException
Description copied from class: ExprInfo
Recursively sends the abstract syntax of this expression to the specified serializer.

Specified by:
plan in class ExprInfo
Parameters:
ser - serializer
Throws:
java.io.IOException - exception

toString

public java.lang.String toString()
Specified by:
toString in class ExprInfo