/** * This code is generated in org.simantics.scl.runtime.generation.GenerateFunctions. * Do not edit manually! */ package org.simantics.scl.runtime.function; import java.util.Arrays; @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(); } @Override public int hashCode() { return f.hashCode() + 31 * Arrays.hashCode(ps); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; UnsaturatedFunctionN other = (UnsaturatedFunctionN) obj; return f.equals(other.f) && Arrays.equals(ps, other.ps); } }