/*
 * EquationElement.java
 *
 * Created on Ketvirtadienis, 2007, Sausio 25, 17.22
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package Main.parser;


public class EquationElement extends AbstractEquationElement
{
	
	public static final String CONSTANT= "CONSTANT"; 
	
	public String mName;
	public double mValue;
	
	public EquationElement()
	{
		mName= CONSTANT;
	}
	
	public EquationElement(String name, double value)
	{
		mName= name;
		mValue= value;
	}
	
	public void setName(String name)
	{
		mName= name;
	}
	
	public void setValue(double value)
	{
		mValue= value;
	}
	
	public double calculate()
	{
		return mValue;
	}
	
	public String toString()
	{
		return mName.equals(CONSTANT)?(""+mValue):mName;
	}

}

