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