slogo.expression
Class VariableFactory

java.lang.Object
  extended by slogo.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

Field Summary
private static VariableFactory ourInstance
           
private static java.util.Map<java.lang.String,Variable> varnameToVariable
           
 
Constructor Summary
private VariableFactory()
           
 
Method Summary
static VariableFactory getInstance()
           
static Variable getVariable(IdentifierToken t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ourInstance

private static VariableFactory ourInstance

varnameToVariable

private static java.util.Map<java.lang.String,Variable> varnameToVariable
Constructor Detail

VariableFactory

private VariableFactory()
Method Detail

getInstance

public static VariableFactory getInstance()

getVariable

public static Variable getVariable(IdentifierToken t)