de.unidu.is.expressions
Class FunctionExpression

java.lang.Object
  extended byde.unidu.is.expressions.AbstractExpression
      extended byde.unidu.is.expressions.FunctionExpression
All Implemented Interfaces:
Expression
Direct Known Subclasses:
Str2NumFunctionExpression

public class FunctionExpression
extends AbstractExpression

An expression for functions.

Since:
2003-10-27
Version:
$Revision: 1.5 $, $Date: 2005/03/01 09:31:24 $
Author:
Henrik Nottelmann

Field Summary
protected  Expression arg
          Function argument.
protected  java.lang.String name
          Function name.
 
Constructor Summary
FunctionExpression(java.lang.String name, Expression arg)
          Creates a new expression object.
 
Method Summary
 Expression getArgument()
          Returns the function argument.
 java.lang.String getName()
          Returns the function name.
 java.lang.String getSQLTemplate()
          Returns a string representation for this expression which can be used as a template in an SQL statement.
 void setArgument(Expression argument)
          Sets the function argument.
 void setName(java.lang.String string)
          Sets the function name.
 Expression substitute(java.util.Map binding)
          Performs an substitution for variables, e.g. for each key variable in the specified binding, all occurences of ${key} are replaced by the corresponding value in the map.
 java.lang.String toString()
          Returns the expression, starting with an ampersand.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Function name.


arg

protected Expression arg
Function argument.

Constructor Detail

FunctionExpression

public FunctionExpression(java.lang.String name,
                          Expression arg)
Creates a new expression object.

Parameters:
name - function name
arg - function argument
Method Detail

substitute

public Expression substitute(java.util.Map binding)
Performs an substitution for variables, e.g. for each key variable in the specified binding, all occurences of ${key} are replaced by the corresponding value in the map.

Only the argument is substituted.

Specified by:
substitute in interface Expression
Overrides:
substitute in class AbstractExpression
Parameters:
binding - variable binding
Returns:
expression after substitution

toString

public java.lang.String toString()
Returns the expression, starting with an ampersand.

Returns:
expression as a string

getSQLTemplate

public java.lang.String getSQLTemplate()
Description copied from class: AbstractExpression
Returns a string representation for this expression which can be used as a template in an SQL statement.

Specified by:
getSQLTemplate in interface Expression
Overrides:
getSQLTemplate in class AbstractExpression
Returns:
template for SQL statements

getArgument

public Expression getArgument()
Returns the function argument.

Returns:
function argument

getName

public java.lang.String getName()
Returns the function name.

Returns:
function name

setArgument

public void setArgument(Expression argument)
Sets the function argument.

Parameters:
argument - function argument

setName

public void setName(java.lang.String string)
Sets the function name.

Parameters:
string - function name