package code.loop.parser;

import java.util.*;
import code.term.*;

/**
 *  Description of the Class
 *
 *@author     jimeng
 *@since    August 2, 2003
 */
public class VarFactory {
    /**
     *  Constructor for the VarFactory object
     */
    private VarFactory() { }


    private static Hashtable table = new Hashtable();


    /**
     *  Gets the variable attribute of the VarFactory class
     *
     *@param  name  Description of the Parameter
     *@return       The variable value
     */
    public static Term getVariable(String name) {
        if (!table.containsKey(name)) {
            table.put(name, new Term(new Variable(name)));
        }
        return (Term) table.get(name);
    }
}
