]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/function/UnsaturatedFunction1.java
Merge branch 'feature/funcwrite'
[simantics/platform.git] / bundles / org.simantics.scl.runtime / src / org / simantics / scl / runtime / function / UnsaturatedFunction1.java
index b3b858236a2b9c017adca1209ea073b4f1499dc9..1dbca0be94f8f223b8d117f7561c228bec085ceb 100644 (file)
@@ -62,6 +62,7 @@ public class UnsaturatedFunction1 implements Function {
             nps[i + 1] = ps[i];
         return f.applyArray(nps);
     }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -70,4 +71,31 @@ public class UnsaturatedFunction1 implements Function {
         sb.append(")");
         return sb.toString();
     }
+
+    @Override
+    public int hashCode() {
+        int result = f.hashCode();
+        result = 31 * result + (p0 == null ? 0 : p0.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;
+        UnsaturatedFunction1 other = (UnsaturatedFunction1) obj;
+        if(!f.equals(other.f))
+            return false;
+        if(p0 == null) {
+            if (other.p0 != null)
+                return false;
+        } else if (!p0.equals(other.p0))
+            return false;
+        return true;
+    }
+
 }