]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/function/FunctionImpl4.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.scl.runtime / src / org / simantics / scl / runtime / function / FunctionImpl4.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 import java.util.Arrays;
8
9 @SuppressWarnings("all")
10 public abstract class FunctionImpl4<P0,P1,P2,P3,R> implements Function<P0,P1,P2,P3,Object,Object,Object,Object,Object,Object,Object,R,Object,Object,Object,Object> {
11     @Override
12     public Object apply(Object p0) {
13         return new UnsaturatedFunction1(this, p0);
14     }
15
16     @Override
17     public Object apply(Object p0, Object p1) {
18         return new UnsaturatedFunction2(this, p0, p1);
19     }
20
21     @Override
22     public Object apply(Object p0, Object p1, Object p2) {
23         return new UnsaturatedFunction3(this, p0, p1, p2);
24     }
25
26     @Override
27     public abstract R apply(P0 p0, P1 p1, P2 p2, P3 p3);
28
29     @Override
30     public Object apply(Object p0, Object p1, Object p2, Object p3, Object p4) {
31         try {
32             return ((Function)apply((P0)p0, (P1)p1, (P2)p2, (P3)p3)).apply(p4);
33         } catch(ClassCastException e) {
34             throw new CalledWithTooManyParameters();
35         }
36     }
37
38     @Override
39     public Object apply(Object p0, Object p1, Object p2, Object p3, Object p4, Object p5) {
40         try {
41             return ((Function)apply((P0)p0, (P1)p1, (P2)p2, (P3)p3)).apply(p4, p5);
42         } catch(ClassCastException e) {
43             throw new CalledWithTooManyParameters();
44         }
45     }
46
47     @Override
48     public Object apply(Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6) {
49         try {
50             return ((Function)apply((P0)p0, (P1)p1, (P2)p2, (P3)p3)).apply(p4, p5, p6);
51         } catch(ClassCastException e) {
52             throw new CalledWithTooManyParameters();
53         }
54     }
55
56     @Override
57     public Object apply(Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) {
58         try {
59             return ((Function)apply((P0)p0, (P1)p1, (P2)p2, (P3)p3)).apply(p4, p5, p6, p7);
60         } catch(ClassCastException e) {
61             throw new CalledWithTooManyParameters();
62         }
63     }
64
65     @Override
66     public Object applyArray(Object ... ps) {
67         switch(ps.length) {
68         case 0:
69             return this;
70         case 1:
71             return new UnsaturatedFunction1(this, ps[0]);
72         case 2:
73             return new UnsaturatedFunction2(this, ps[0], ps[1]);
74         case 3:
75             return new UnsaturatedFunction3(this, ps[0], ps[1], ps[2]);
76         case 4:
77             return apply((P0)ps[0], (P1)ps[1], (P2)ps[2], (P3)ps[3]);
78         case 5:
79             try {
80                 return ((Function)apply((P0)ps[0], (P1)ps[1], (P2)ps[2], (P3)ps[3])).apply(ps[4]);
81             } catch(ClassCastException e) {
82                 throw new CalledWithTooManyParameters();
83             }
84         case 6:
85             try {
86                 return ((Function)apply((P0)ps[0], (P1)ps[1], (P2)ps[2], (P3)ps[3])).apply(ps[4], ps[5]);
87             } catch(ClassCastException e) {
88                 throw new CalledWithTooManyParameters();
89             }
90         case 7:
91             try {
92                 return ((Function)apply((P0)ps[0], (P1)ps[1], (P2)ps[2], (P3)ps[3])).apply(ps[4], ps[5], ps[6]);
93             } catch(ClassCastException e) {
94                 throw new CalledWithTooManyParameters();
95             }
96         case 8:
97             try {
98                 return ((Function)apply((P0)ps[0], (P1)ps[1], (P2)ps[2], (P3)ps[3])).apply(ps[4], ps[5], ps[6], ps[7]);
99             } catch(ClassCastException e) {
100                 throw new CalledWithTooManyParameters();
101             }
102         case 9:
103             try {
104                 return ((Function)apply((P0)ps[0], (P1)ps[1], (P2)ps[2], (P3)ps[3])).apply(ps[4], ps[5], ps[6], ps[7], ps[8]);
105             } catch(ClassCastException e) {
106                 throw new CalledWithTooManyParameters();
107             }
108         case 10:
109             try {
110                 return ((Function)apply((P0)ps[0], (P1)ps[1], (P2)ps[2], (P3)ps[3])).apply(ps[4], ps[5], ps[6], ps[7], ps[8], ps[9]);
111             } catch(ClassCastException e) {
112                 throw new CalledWithTooManyParameters();
113             }
114         case 11:
115             try {
116                 return ((Function)apply((P0)ps[0], (P1)ps[1], (P2)ps[2], (P3)ps[3])).apply(ps[4], ps[5], ps[6], ps[7], ps[8], ps[9], ps[10]);
117             } catch(ClassCastException e) {
118                 throw new CalledWithTooManyParameters();
119             }
120         case 12:
121             try {
122                 return ((Function)apply((P0)ps[0], (P1)ps[1], (P2)ps[2], (P3)ps[3])).apply(ps[4], ps[5], ps[6], ps[7], ps[8], ps[9], ps[10], ps[11]);
123             } catch(ClassCastException e) {
124                 throw new CalledWithTooManyParameters();
125             }
126         default:
127             try {
128                 return ((Function)apply((P0)ps[0], (P1)ps[1], (P2)ps[2], (P3)ps[3])).apply(Arrays.copyOfRange(ps, 4, ps.length));
129             } catch(ClassCastException e) {
130                 throw new CalledWithTooManyParameters();
131             }
132         }
133     }
134 }