de.unidu.is.expressions
Class VariableExpression

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

public class VariableExpression
extends AbstractExpression

An expression for a variable.

Since:
2003-10-21
Version:
$Revision: 1.5 $, $Date: 2005/03/14 17:33:14 $
Author:
Henrik Nottelmann

Field Summary
protected  java.lang.String name
          The variable name of this expression.
 
Constructor Summary
VariableExpression(java.lang.String name)
          Creates a new expression object.
 
Method Summary
 boolean equals(java.lang.Object o)
          Tests whether this expressions equals the specified VariableExpression.
 java.lang.String get()
          Returns the variable name of this expression.
 int hashCode()
          Returns the hashcode of this expression object.
 void set(java.lang.String name)
          Sets the variable name of this expression.
 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 variable name of this expression.
 
Methods inherited from class de.unidu.is.expressions.AbstractExpression
getSQLTemplate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
The variable name of this expression.

Constructor Detail

VariableExpression

public VariableExpression(java.lang.String name)
Creates a new expression object.

Parameters:
name - variable name of this expression
Method Detail

get

public java.lang.String get()
Returns the variable name of this expression.

Returns:
variable name of this expression

set

public void set(java.lang.String name)
Sets the variable name of this expression.

Parameters:
name - name of this expression

toString

public java.lang.String toString()
Returns the variable name of this expression.

Returns:
content of this expression

equals

public boolean equals(java.lang.Object o)
Tests whether this expressions equals the specified VariableExpression.

Parameters:
o - expression to test
Returns:
true iff both expressions are equal

hashCode

public int hashCode()
Returns the hashcode of this expression object.

Returns:
hashcode of this expression object

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.

Here, the variable is substituted if possible.

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