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