1 package org.simantics.spreadsheet.graph;
3 import java.io.Serializable;
5 import org.simantics.spreadsheet.graph.parser.ast.AstValue;
7 public class SpreadsheetFormula implements Serializable {
9 private static final long serialVersionUID = -3369406031425959191L;
11 public AstValue value;
12 public String expression;
15 public SpreadsheetFormula(AstValue value, String expression) {
17 this.expression = expression;
21 public int hashCode() {
24 result = prime * result + ((expression == null) ? 0 : expression.hashCode());
29 public boolean equals(Object obj) {
34 if (getClass() != obj.getClass())
36 SpreadsheetFormula other = (SpreadsheetFormula) obj;
37 if (expression == null) {
38 if (other.expression != null)
40 } else if (!expression.equals(other.expression))
46 public String toString() {
47 return getClass().getSimpleName() + " [" + expression +" => " + result != null ? result.toString() : "" + "]";