package org.lvcp.eepperly.expr;

import java.util.List;

/**
 * Created by eepperly16 on 12/11/15.
 */
public class Variable implements Expr {
	private String varName;
	public Variable(List<Expr> arguments) {
		varName = "X";
	}

	public Expr differentiate(){
		return Expr.ONE;
	}
	public double evaluate(double value){ return value; }
	public String toString(){
		return varName;
	}
	public boolean equals(Object obj){
		return obj instanceof Variable;
	}
}

@@ -182,28 +182,8 @@
 ble(
-List%3CExpr%3E arguments
 ) %7B%0A
@@ -202,16 +202,90 @@
 %22X%22;%0A%09%7D%0A
+%09public Variable(String varName)%7B%0A%09%09this.varName = varName;%0A%09%7D%0A%0A%09@Override
 %0A%09public
@@ -324,24 +324,36 @@
 Expr.ONE;%0A%09%7D
+%0A%0A%09@Override
 %0A%09public dou
@@ -395,16 +395,28 @@
 value; %7D
+%0A%0A%09@Override
 %0A%09public
@@ -451,24 +451,88 @@
  varName;%0A%09%7D
+%0A%0A%09public String getVarName() %7B%0A%09%09return varName;%0A%09%7D%0A%0A%09@Override
 %0A%09public boo
@@ -555,45 +555,323 @@
 ct o
-bj
 )
+ 
 %7B%0A%09%09
-return obj instanceof Variable
+if (this == o) return true;%0A%09%09if (o == null %7C%7C getClass() != o.getClass()) return false;%0A%0A%09%09Variable variable = (Variable) o;%0A%0A%09%09return !(varName != null ? !varName.equals(variable.varName) : variable.varName != null);%0A%0A%09%7D%0A%0A%09@Override%0A%09public int hashCode() %7B%0A%09%09return varName != null ? varName.hashCode() : 0
 ;%0A%09%7D

Add variable equality and improve constructor