I am writing code for an algebra program to manipulate equations. I have the code for the Expression interface, and it compiled correctly. I also have the code for the Variable class, and it is failing to compile and raising the "error: cannot find symbol" for the Expression interface. They are in the same folder (in a "SymbolicExpressions" folder which is itself in an "Algebra" folder). I do not understand what is going wrong. Perhaps I have an environment variable set incorrectly. Any help you can provide would be much appreciated. Here is the code for the interface and the class:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author zach
*/
public interface Expression extends Cloneable {
abstract public Expression evaluate(Expression v, Expression e);
abstract public Expression clone();
abstract public Expression fullSimplify();
abstract public Expression simpleSimplify();
}
import java.util.ArrayList;
import Algebra.SymbolicExpressions.Expression;
import java.lang.Character;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author zach
*/
public class Variable implements Expression, Comparable<Variable>, Cloneable {
private char name;
private ArrayList<Expression> subscripts;
//Must implement infrastructure for subscripts, derivative superscripts. Potential implementation: earlier subscripts rank a higher order on the variable than later superscripts. In other words earlier subscripts decide variable's implementation of comparable before later subscripts. Superscript derivatives give higher priority based on the highest priority derivative's lowest order. Hopefully that makes sense the next time this comment is read
public Variable(char myName, ArrayList<Expression> subscriptInputs) {
name = myName;
for (Expression e: subscriptInputs) {
subscripts.add(e);
}
}
public Expression evaluate(Expression v, Expression e) {
if (this.compareTo(v)) {
return e;
}
return this;
}
@Override
public int hashCode() {
return Character.valueOf(name).hashCode();
}
public Expression fullSimplify() {
return this.clone(); //To change body of generated methods, choose Tools | Templates.
}
public Expression simpleSimplify() {
return this.clone(); //To change body of generated methods, choose Tools | Templates.
}
public int compareTo(Variable toCompare) {
return this.hashCode() - toCompare.hashCode();
}
public Expression clone() {
return new Variable(this.name, this.subscripts);
}
}