org.basex.query.util
Class Functions

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

public final class Functions
extends ExprInfo

Global expression context.

Author:
Workgroup DBIS, University of Konstanz 2005-10, 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(QueryContext 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, QueryContext ctx)
          Returns the specified function.
 void plan(Serializer ser)
          Recursively sends the abstract syntax of this expression to the specified serializer.
 String toString()
           
 
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,
                QueryContext ctx)
         throws QueryException
Returns the specified function.

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

add

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

Parameters:
fun - function instance
Returns:
function id
Throws:
QueryException - query exception

comp

public void comp(QueryContext ctx)
          throws QueryException
Compiles the functions.

Parameters:
ctx - query context
Throws:
QueryException - query exception

check

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

Throws:
QueryException - query exception

funError

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

Parameters:
name - function name
Throws:
QueryException - query exception

plan

public void plan(Serializer ser)
          throws 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:
IOException - I/O exception

toString

public String toString()
Specified by:
toString in class ExprInfo