za.ac.sun.cs.green.expr.IntVariable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of green Show documentation
Show all versions of green Show documentation
Universal interface to decision procedures, constraint solvers, model counters, and related tools
The newest version!
package za.ac.sun.cs.green.expr;
public class IntVariable extends Variable {
private static final long serialVersionUID = 8942503924718973792L;
private final Integer lowerBound;
private final Integer upperBound;
public IntVariable(String name, Integer lowerBound, Integer upperBound) {
super(name);
this.lowerBound = lowerBound;
this.upperBound = upperBound;
}
public IntVariable(String name, Object original, Integer lowerBound, Integer upperBound) {
super(name, original);
this.lowerBound = lowerBound;
this.upperBound = upperBound;
}
public Integer getLowerBound() {
return lowerBound;
}
public Integer getUpperBound() {
return upperBound;
}
@Override
public void accept(Visitor visitor) throws VisitorException {
visitor.preVisit(this);
visitor.postVisit(this);
}
// @Override
// public int compareTo(Expression expression) {
// IntVariable variable = (IntVariable) expression;
// return getName().compareTo(variable.getName());
// }
@Override
public boolean equals(Object object) {
if (object instanceof IntVariable) {
IntVariable variable = (IntVariable) object;
return getName().equals(variable.getName());
} else {
return false;
}
}
@Override
public int hashCode() {
return getName().hashCode();
}
@Override
public String toString0() {
return getName();
}
}