For condition.accept
I get the error "cannot resolve method 'accept(cs4321.project2.Operators.SelectExpressionVisitor)". I'm not sure why because I'm following the Expression accept
method syntax correctly.
public class SelectExpressionVisitor implements ExpressionVisitor {
private Tuple tuple;
private Map<String, Integer> colToTupleIndexMap;
private boolean tupleFollowsCondition;
public SelectExpressionVisitor(Tuple tuple) {
this.tuple = tuple;
colToTupleIndexMap = DatabaseCatalog.getInstance()
.colToTupleIndexMap;
tupleFollowsCondition = false;
}
public Tuple getSelectTuple(Expression condition) {
condition.accept(this);
if(tupleFollowsCondition) {
return tuple;
}
return null;
}
}
I realized I imported the wrong Expression class, which didn't have an accept method.
Correct import statement