Class Variable

java.lang.Object
  |
  +--Ident
        |
        +--Variable

public class Variable
extends Ident

This class represents a variable indentifier.

Author:
P. URSO
See Also:
Type

Constructor Summary
Variable(String name, Type type)
          Constructor of the variable.
Variable(Type type)
          Construct a new variable from a specified type.
 
Method Summary
 Type getType()
          Returns the type of the variable.
 String toString()
          Returns a string representation of this variable.
 
Methods inherited from class Ident
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Variable

public Variable(String name,
                Type type)
Constructor of the variable.
Parameters:
name - name of the variable.
type - type of the variable.

Variable

public Variable(Type type)
Construct a new variable from a specified type. The name of the variable will be the first letter of name of the type followed by an uniq number.
Parameters:
type - the type of the variable.
Method Detail

getType

public Type getType()
Returns the type of the variable.
Returns:
the type of the variable.

toString

public String toString()
Returns a string representation of this variable.
Overrides:
toString in class Ident
Returns:
the name of variable and its type.