X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.spreadsheet%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2Fsolver%2FSpreadsheetSCLConstant.java;fp=bundles%2Forg.simantics.spreadsheet%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2Fsolver%2FSpreadsheetSCLConstant.java;h=cc0148edbd8a4c73f33422cd4d61ce8e0bbad296;hb=5c67a96d34fe904b8c4b0375cd08ff1d543bf369;hp=0000000000000000000000000000000000000000;hpb=9a37dabc6c0212ed3e14499c88df3208cd06f9b0;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetSCLConstant.java b/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetSCLConstant.java new file mode 100644 index 000000000..cc0148edb --- /dev/null +++ b/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/SpreadsheetSCLConstant.java @@ -0,0 +1,60 @@ +package org.simantics.spreadsheet.solver; + +import java.io.Serializable; + +import org.simantics.databoard.Bindings; +import org.simantics.databoard.binding.Binding; + +public class SpreadsheetSCLConstant implements Serializable { + + private static final long serialVersionUID = 428064772427245449L; + + private String expression; + private Object content; + + public static final Binding BINDING = Bindings.getBindingUnchecked(SpreadsheetSCLConstant.class); + + public SpreadsheetSCLConstant(String expression, Object object) { + this.content = object; + this.expression = expression; + } + + public Object getContent() { + return content; + } + + public String getExpression() { + return expression; + } + + @Override + public String toString() { + return super.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((expression == null) ? 0 : expression.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + SpreadsheetSCLConstant other = (SpreadsheetSCLConstant) obj; + if (expression == null) { + if (other.expression != null) + return false; + } else if (!expression.equals(other.expression)) + return false; + return true; + } + +}