001package daikon.inv.filter;
002
003import daikon.inv.Invariant;
004
005public class VariableFilter extends InvariantFilter {
006  // This method is more for the property filters, but we need to implement
007  // it because it's abstract.
008  @Override
009  public String getDescription() {
010    return "Variable filter on '" + variable + "'";
011  }
012
013  String variable;
014
015  public VariableFilter(String variable) {
016    this.variable = variable;
017  }
018
019  public String getVariable() {
020    return variable;
021  }
022
023  @Override
024  boolean shouldDiscardInvariant(Invariant invariant) {
025    return !invariant.usesVar(variable);
026  }
027}