2 * This code is generated in org.simantics.scl.runtime.generation.GenerateFunctions.
3 * Do not edit manually!
5 package org.simantics.scl.runtime.function;
7 import java.util.Arrays;
9 @SuppressWarnings("all")
10 public class UnsaturatedFunctionN implements Function {
11 private final Function f;
12 private final Object[] ps;
14 public UnsaturatedFunctionN(Function f, Object ... ps) {
20 public Object apply(Object p1) {
21 Object[] nps = new Object[ps.length + 1];
22 System.arraycopy(ps, 0, nps, 0, ps.length);
23 nps[ps.length+0] = p1;
24 return f.applyArray(nps);
28 public Object apply(Object p1, Object p2) {
29 Object[] nps = new Object[ps.length + 2];
30 System.arraycopy(ps, 0, nps, 0, ps.length);
31 nps[ps.length+0] = p1;
32 nps[ps.length+1] = p2;
33 return f.applyArray(nps);
37 public Object apply(Object p1, Object p2, Object p3) {
38 Object[] nps = new Object[ps.length + 3];
39 System.arraycopy(ps, 0, nps, 0, ps.length);
40 nps[ps.length+0] = p1;
41 nps[ps.length+1] = p2;
42 nps[ps.length+2] = p3;
43 return f.applyArray(nps);
47 public Object apply(Object p1, Object p2, Object p3, Object p4) {
48 Object[] nps = new Object[ps.length + 4];
49 System.arraycopy(ps, 0, nps, 0, ps.length);
50 nps[ps.length+0] = p1;
51 nps[ps.length+1] = p2;
52 nps[ps.length+2] = p3;
53 nps[ps.length+3] = p4;
54 return f.applyArray(nps);
58 public Object apply(Object p1, Object p2, Object p3, Object p4, Object p5) {
59 Object[] nps = new Object[ps.length + 5];
60 System.arraycopy(ps, 0, nps, 0, ps.length);
61 nps[ps.length+0] = p1;
62 nps[ps.length+1] = p2;
63 nps[ps.length+2] = p3;
64 nps[ps.length+3] = p4;
65 nps[ps.length+4] = p5;
66 return f.applyArray(nps);
70 public Object apply(Object p1, Object p2, Object p3, Object p4, Object p5, Object p6) {
71 Object[] nps = new Object[ps.length + 6];
72 System.arraycopy(ps, 0, nps, 0, ps.length);
73 nps[ps.length+0] = p1;
74 nps[ps.length+1] = p2;
75 nps[ps.length+2] = p3;
76 nps[ps.length+3] = p4;
77 nps[ps.length+4] = p5;
78 nps[ps.length+5] = p6;
79 return f.applyArray(nps);
83 public Object apply(Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) {
84 Object[] nps = new Object[ps.length + 7];
85 System.arraycopy(ps, 0, nps, 0, ps.length);
86 nps[ps.length+0] = p1;
87 nps[ps.length+1] = p2;
88 nps[ps.length+2] = p3;
89 nps[ps.length+3] = p4;
90 nps[ps.length+4] = p5;
91 nps[ps.length+5] = p6;
92 nps[ps.length+6] = p7;
93 return f.applyArray(nps);
97 public Object apply(Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8) {
98 Object[] nps = new Object[ps.length + 8];
99 System.arraycopy(ps, 0, nps, 0, ps.length);
100 nps[ps.length+0] = p1;
101 nps[ps.length+1] = p2;
102 nps[ps.length+2] = p3;
103 nps[ps.length+3] = p4;
104 nps[ps.length+4] = p5;
105 nps[ps.length+5] = p6;
106 nps[ps.length+6] = p7;
107 nps[ps.length+7] = p8;
108 return f.applyArray(nps);
112 public Object applyArray(Object ... ops) {
113 Object[] nps = new Object[ps.length + ops.length];
114 System.arraycopy(ps, 0, nps, 0, ps.length);
115 System.arraycopy(ops, 0, nps, ps.length, ops.length);
116 return f.applyArray(nps);
120 public String toString() {
121 StringBuilder sb = new StringBuilder();
122 sb.append("(").append(f);
124 sb.append(" ").append(p);
126 return sb.toString();
130 public int hashCode() {
131 return f.hashCode() + 31 * Arrays.hashCode(ps);
135 public boolean equals(Object obj) {
140 if (getClass() != obj.getClass())
142 UnsaturatedFunctionN other = (UnsaturatedFunctionN) obj;
143 return f.equals(other.f) && Arrays.equals(ps, other.ps);