1 package org.simantics.spreadsheet.solver;
3 import java.io.Serializable;
5 import org.simantics.databoard.Bindings;
6 import org.simantics.databoard.binding.Binding;
7 import org.simantics.spreadsheet.solver.formula.parser.ast.AstValue;
9 public class SpreadsheetFormula implements Serializable {
11 public static Binding BINDING = Bindings.getBindingUnchecked(SpreadsheetFormula.class);
13 private static final long serialVersionUID = -3369406031425959191L;
15 public AstValue value;
16 public String expression;
19 public SpreadsheetFormula(AstValue value, String expression) {
21 this.expression = expression;
25 public int hashCode() {
28 result = prime * result + ((expression == null) ? 0 : expression.hashCode());
33 public boolean equals(Object obj) {
38 if (getClass() != obj.getClass())
40 SpreadsheetFormula other = (SpreadsheetFormula) obj;
41 if (expression == null) {
42 if (other.expression != null)
44 } else if (!expression.equals(other.expression))
50 public String toString() {
51 return getClass().getSimpleName() + " [" + expression +" => " + result != null ? result.toString() : "" + "]";