]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/function/UnsaturatedFunction2.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.scl.runtime / src / org / simantics / scl / runtime / function / UnsaturatedFunction2.java
1 /**
2  * This code is generated in org.simantics.scl.runtime.generation.GenerateFunctions.
3  * Do not edit manually!
4  */
5 package org.simantics.scl.runtime.function;
6
7 @SuppressWarnings("all")
8 public class UnsaturatedFunction2 implements Function {
9     private final Function f;
10     private final Object p0;
11     private final Object p1;
12
13     public UnsaturatedFunction2(Function f, Object p0, Object p1) {
14         this.f = f;
15         this.p0 = p0;
16         this.p1 = p1;
17     }
18
19     @Override
20     public Object apply(Object p2) {
21         return f.apply(p0, p1, p2);
22     }
23
24     @Override
25     public Object apply(Object p2, Object p3) {
26         return f.apply(p0, p1, p2, p3);
27     }
28
29     @Override
30     public Object apply(Object p2, Object p3, Object p4) {
31         return f.apply(p0, p1, p2, p3, p4);
32     }
33
34     @Override
35     public Object apply(Object p2, Object p3, Object p4, Object p5) {
36         return f.apply(p0, p1, p2, p3, p4, p5);
37     }
38
39     @Override
40     public Object apply(Object p2, Object p3, Object p4, Object p5, Object p6) {
41         return f.apply(p0, p1, p2, p3, p4, p5, p6);
42     }
43
44     @Override
45     public Object apply(Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) {
46         return f.apply(p0, p1, p2, p3, p4, p5, p6, p7);
47     }
48
49     @Override
50     public Object apply(Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8) {
51         return f.applyArray(p0, p1, p2, p3, p4, p5, p6, p7, p8);
52     }
53
54     @Override
55     public Object apply(Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8, Object p9) {
56         return f.applyArray(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
57     }
58
59     @Override
60     public Object applyArray(Object ... ps) {
61         Object[] nps = new Object[ps.length + 2];
62         nps[0] = p0;
63         nps[1] = p1;
64         for(int i=0;i<ps.length;++i)
65             nps[i + 2] = ps[i];
66         return f.applyArray(nps);
67     }
68
69     @Override
70     public String toString() {
71         StringBuilder sb = new StringBuilder();
72         sb.append("(").append(f);
73         sb.append(" ").append(p0);
74         sb.append(" ").append(p1);
75         sb.append(")");
76         return sb.toString();
77     }
78
79     @Override
80     public int hashCode() {
81         int result = f.hashCode();
82         result = 31 * result + (p0 == null ? 0 : p0.hashCode());
83         result = 31 * result + (p1 == null ? 0 : p1.hashCode());
84         return result;
85     }
86
87     @Override
88     public boolean equals(Object obj) {
89         if (this == obj)
90             return true;
91         if (obj == null)
92             return false;
93         if (getClass() != obj.getClass())
94             return false;
95         UnsaturatedFunction2 other = (UnsaturatedFunction2) obj;
96         if(!f.equals(other.f))
97             return false;
98         if(p0 == null) {
99             if (other.p0 != null)
100                 return false;
101         } else if (!p0.equals(other.p0))
102             return false;
103         if(p1 == null) {
104             if (other.p1 != null)
105                 return false;
106         } else if (!p1.equals(other.p1))
107             return false;
108         return true;
109     }
110
111 }