]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetSCLConstant.java
Introduce new DiagramViewer.getRuntimeFromManager()
[simantics/platform.git] / bundles / org.simantics.spreadsheet / src / org / simantics / spreadsheet / solver / SpreadsheetSCLConstant.java
1 package org.simantics.spreadsheet.solver;
2
3 import java.io.Serializable;
4
5 import org.simantics.databoard.Bindings;
6 import org.simantics.databoard.binding.Binding;
7
8 public class SpreadsheetSCLConstant implements Serializable {
9
10     private static final long serialVersionUID = 428064772427245449L;
11
12     private String expression;
13     private Object content;
14
15     public static final Binding BINDING = Bindings.getBindingUnchecked(SpreadsheetSCLConstant.class);
16
17     public SpreadsheetSCLConstant(String expression, Object object) {
18         this.content = object;
19         this.expression = expression;
20     }
21
22     public Object getContent() {
23         return content;
24     }
25     
26     public String getExpression() {
27         return expression;
28     }
29     
30     @Override
31     public String toString() {
32         return super.toString();
33     }
34
35     @Override
36     public int hashCode() {
37         final int prime = 31;
38         int result = 1;
39         result = prime * result + ((expression == null) ? 0 : expression.hashCode());
40         return result;
41     }
42
43     @Override
44     public boolean equals(Object obj) {
45         if (this == obj)
46             return true;
47         if (obj == null)
48             return false;
49         if (getClass() != obj.getClass())
50             return false;
51         SpreadsheetSCLConstant other = (SpreadsheetSCLConstant) obj;
52         if (expression == null) {
53             if (other.expression != null)
54                 return false;
55         } else if (!expression.equals(other.expression))
56             return false;
57         return true;
58     }
59
60 }