jelan.elan.expression
Class VariableFactory

java.lang.Object
  extended by jelan.elan.expression.VariableFactory

public class VariableFactory
extends java.lang.Object

Clients can use this class to obtain a unique variable per identifier (avoiding a proliferation of objects)

Author:
Owen Astrachan

Method Summary
static VariableFactory getInstance()
          Used to get the one instance of the VariableFactory.
static Variable getVariable(IdentifierToken t)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static VariableFactory getInstance()
Used to get the one instance of the VariableFactory. (We don't want multiple variable factories.)

Returns:

getVariable

public static Variable getVariable(IdentifierToken t)
Parameters:
t -
Returns:
the Variable identified by the token t; if no variable with that name already exists, creates mapping between the token and a new variable