org.basex.query.xquery.util
Class Functions

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

public final class Functions
extends java.lang.Object

Global expression context.

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

Constructor Summary
Functions()
           
 
Method Summary
 int add(XQContext ctx, Func func)
          Adds a local function.
 void check()
          Checks if all functions have been correctly initialized.
 void comp(XQContext ctx)
          Compiles the functions.
 void error(QNm name)
          Finds similar function names for throwing an error message.
 Func get(int id)
          Returns the function with the specified id.
 Expr get(XQContext ctx, QNm name, Expr[] args)
          Returns the specified function.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Functions

public Functions()
Method Detail

add

public int add(XQContext ctx,
               Func func)
        throws XQException
Adds a local function.

Parameters:
ctx - query context
func - function instance
Returns:
function id
Throws:
XQException - evaluation exception

check

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

Throws:
XQException - xquery exception

comp

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

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

error

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

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

get

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

Parameters:
id - function id
Returns:
function

get

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

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