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