X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fruntime%2Ffunction%2FUnsaturatedFunctionN.java;fp=bundles%2Forg.simantics.scl.runtime%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fruntime%2Ffunction%2FUnsaturatedFunctionN.java;h=b82629f239566b84aacf96da351ee99605370814;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/function/UnsaturatedFunctionN.java b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/function/UnsaturatedFunctionN.java new file mode 100755 index 000000000..b82629f23 --- /dev/null +++ b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/function/UnsaturatedFunctionN.java @@ -0,0 +1,125 @@ +/** + * This code is generated in org.simantics.scl.runtime.generation.GenerateFunctions. + * Do not edit manually! + */ +package org.simantics.scl.runtime.function; + +@SuppressWarnings("all") +public class UnsaturatedFunctionN implements Function { + private final Function f; + private final Object[] ps; + + public UnsaturatedFunctionN(Function f, Object ... ps) { + this.f = f; + this.ps = ps; + } + + @Override + public Object apply(Object p1) { + Object[] nps = new Object[ps.length + 1]; + System.arraycopy(ps, 0, nps, 0, ps.length); + nps[ps.length+0] = p1; + return f.applyArray(nps); + } + + @Override + public Object apply(Object p1, Object p2) { + Object[] nps = new Object[ps.length + 2]; + System.arraycopy(ps, 0, nps, 0, ps.length); + nps[ps.length+0] = p1; + nps[ps.length+1] = p2; + return f.applyArray(nps); + } + + @Override + public Object apply(Object p1, Object p2, Object p3) { + Object[] nps = new Object[ps.length + 3]; + System.arraycopy(ps, 0, nps, 0, ps.length); + nps[ps.length+0] = p1; + nps[ps.length+1] = p2; + nps[ps.length+2] = p3; + return f.applyArray(nps); + } + + @Override + public Object apply(Object p1, Object p2, Object p3, Object p4) { + Object[] nps = new Object[ps.length + 4]; + System.arraycopy(ps, 0, nps, 0, ps.length); + nps[ps.length+0] = p1; + nps[ps.length+1] = p2; + nps[ps.length+2] = p3; + nps[ps.length+3] = p4; + return f.applyArray(nps); + } + + @Override + public Object apply(Object p1, Object p2, Object p3, Object p4, Object p5) { + Object[] nps = new Object[ps.length + 5]; + System.arraycopy(ps, 0, nps, 0, ps.length); + nps[ps.length+0] = p1; + nps[ps.length+1] = p2; + nps[ps.length+2] = p3; + nps[ps.length+3] = p4; + nps[ps.length+4] = p5; + return f.applyArray(nps); + } + + @Override + public Object apply(Object p1, Object p2, Object p3, Object p4, Object p5, Object p6) { + Object[] nps = new Object[ps.length + 6]; + System.arraycopy(ps, 0, nps, 0, ps.length); + nps[ps.length+0] = p1; + nps[ps.length+1] = p2; + nps[ps.length+2] = p3; + nps[ps.length+3] = p4; + nps[ps.length+4] = p5; + nps[ps.length+5] = p6; + return f.applyArray(nps); + } + + @Override + public Object apply(Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) { + Object[] nps = new Object[ps.length + 7]; + System.arraycopy(ps, 0, nps, 0, ps.length); + nps[ps.length+0] = p1; + nps[ps.length+1] = p2; + nps[ps.length+2] = p3; + nps[ps.length+3] = p4; + nps[ps.length+4] = p5; + nps[ps.length+5] = p6; + nps[ps.length+6] = p7; + return f.applyArray(nps); + } + + @Override + public Object apply(Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8) { + Object[] nps = new Object[ps.length + 8]; + System.arraycopy(ps, 0, nps, 0, ps.length); + nps[ps.length+0] = p1; + nps[ps.length+1] = p2; + nps[ps.length+2] = p3; + nps[ps.length+3] = p4; + nps[ps.length+4] = p5; + nps[ps.length+5] = p6; + nps[ps.length+6] = p7; + nps[ps.length+7] = p8; + return f.applyArray(nps); + } + + @Override + public Object applyArray(Object ... ops) { + Object[] nps = new Object[ps.length + ops.length]; + System.arraycopy(ps, 0, nps, 0, ps.length); + System.arraycopy(ops, 0, nps, ps.length, ops.length); + return f.applyArray(nps); + } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("(").append(f); + for (Object p : ps) + sb.append(" ").append(p); + sb.append(")"); + return sb.toString(); + } +}