com.satline.expr
Class Variable

java.lang.Object
  extended by com.satline.expr.Variable
All Implemented Interfaces:
Expression, java.io.Serializable

public class Variable
extends java.lang.Object
implements Expression

Definition of a variable in an expression.

Author:
tomas
See Also:
Serialized Form

Constructor Summary
Variable()
          Default constructor.
Variable(java.lang.String name)
           
Variable(java.lang.String name, ExpressionType type)
          Constructor from name.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this object against the specified object.
 java.lang.String getName()
          Get variable name.
 ExpressionType getType()
           
<E,F> E
greet(ExpressionWalker<E,F> visitor, F arg)
          Handle visit of ExpressionWalker.
 int hashCode()
           
 void setName(java.lang.String name)
          Set variable name.
 void setType(ExpressionType 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(java.lang.String name,
                ExpressionType type)
Constructor from name.

Parameters:
name - - variable name
type - - variable type

Variable

public Variable(java.lang.String name)
Method Detail

getName

public java.lang.String getName()
Get variable name.

Returns:
name.

setName

public void setName(java.lang.String name)
Set variable name.

Parameters:
name - - name to set.

getType

public ExpressionType getType()
Returns:
Returns the type.

setType

public void setType(ExpressionType type)
Parameters:
type - The type to set.

greet

public <E,F> E greet(ExpressionWalker<E,F> visitor,
                     F arg)
        throws ExpressionException
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(java.lang.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 java.lang.Object
Parameters:
obj - - object to compare with
Returns:
true if the objects are the same, false otherwise

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2007 null. All Rights Reserved.