common-util

local.tomas.expr
Class Variable

java.lang.Object
  extended by local.tomas.expr.Variable
All Implemented Interfaces:
Serializable, Expression

public class Variable
extends Object
implements Expression

Definition of a variable in an expression.

Author:
tomas
See Also:
Serialized Form

Constructor Summary
Variable()
          Default constructor.
Variable(String name)
          Constructor from name.
Variable(String name, ExpressionType type)
          Constructor from name and type.
 
Method Summary
 boolean equals(Object obj)
          Compares this object against the specified object.
 String getName()
          Get variable name.
 ExpressionType getType()
          Get the type.
<E,F> E
greet(ExpressionWalker<E,F> visitor, F arg)
          Handle visit of ExpressionWalker.
 int hashCode()
           
 void setName(String name)
          Set variable name.
 void setType(ExpressionType type)
          Set the type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Variable

public Variable()
Default constructor.


Variable

public Variable(String name,
                ExpressionType type)
Constructor from name and type.

Parameters:
name - variable name
type - variable type

Variable

public Variable(String name)
Constructor from name.

Parameters:
name - variable name
Method Detail

getName

public String getName()
Get variable name.

Returns:
name.

setName

public void setName(String name)
Set variable name.

Parameters:
name - name to set.

getType

public ExpressionType getType()
Get the type.

Returns:
Returns the type.

setType

public void setType(ExpressionType type)
Set the type.

Parameters:
type - The type to set.

greet

public <E,F> E greet(ExpressionWalker<E,F> visitor,
                     F arg)
        throws ExpressionException
Description copied from interface: Expression
Handle visit of ExpressionWalker.

Specified by:
greet in interface Expression
Parameters:
visitor - the ExpressionWalker visiting this object
arg - implementation dependent argument
Returns:
implementation dependent result
Throws:
ExpressionException

equals

public boolean equals(Object obj)
Compares this object against the specified object. The result is true if and only if the argument is not null and is a Variable object with equal name as this object.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.