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