/** * 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 abstract class FunctionImpl2 implements Function { @Override public Object apply(Object p0) { return new UnsaturatedFunction1(this, p0); } @Override public abstract R apply(P0 p0, P1 p1); @Override public Object apply(Object p0, Object p1, Object p2) { try { return ((Function)apply((P0)p0, (P1)p1)).apply(p2); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } } @Override public Object apply(Object p0, Object p1, Object p2, Object p3) { try { return ((Function)apply((P0)p0, (P1)p1)).apply(p2, p3); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } } @Override public Object apply(Object p0, Object p1, Object p2, Object p3, Object p4) { try { return ((Function)apply((P0)p0, (P1)p1)).apply(p2, p3, p4); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } } @Override public Object apply(Object p0, Object p1, Object p2, Object p3, Object p4, Object p5) { try { return ((Function)apply((P0)p0, (P1)p1)).apply(p2, p3, p4, p5); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } } @Override public Object apply(Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6) { try { return ((Function)apply((P0)p0, (P1)p1)).apply(p2, p3, p4, p5, p6); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } } @Override public Object apply(Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) { try { return ((Function)apply((P0)p0, (P1)p1)).apply(p2, p3, p4, p5, p6, p7); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } } @Override public Object applyArray(Object ... ps) { switch(ps.length) { case 0: return this; case 1: return new UnsaturatedFunction1(this, ps[0]); case 2: return apply((P0)ps[0], (P1)ps[1]); case 3: try { return ((Function)apply((P0)ps[0], (P1)ps[1])).apply(ps[2]); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } case 4: try { return ((Function)apply((P0)ps[0], (P1)ps[1])).apply(ps[2], ps[3]); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } case 5: try { return ((Function)apply((P0)ps[0], (P1)ps[1])).apply(ps[2], ps[3], ps[4]); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } case 6: try { return ((Function)apply((P0)ps[0], (P1)ps[1])).apply(ps[2], ps[3], ps[4], ps[5]); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } case 7: try { return ((Function)apply((P0)ps[0], (P1)ps[1])).apply(ps[2], ps[3], ps[4], ps[5], ps[6]); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } case 8: try { return ((Function)apply((P0)ps[0], (P1)ps[1])).apply(ps[2], ps[3], ps[4], ps[5], ps[6], ps[7]); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } case 9: try { return ((Function)apply((P0)ps[0], (P1)ps[1])).apply(ps[2], ps[3], ps[4], ps[5], ps[6], ps[7], ps[8]); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } case 10: try { return ((Function)apply((P0)ps[0], (P1)ps[1])).apply(ps[2], ps[3], ps[4], ps[5], ps[6], ps[7], ps[8], ps[9]); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } default: try { return ((Function)apply((P0)ps[0], (P1)ps[1])).apply(Arrays.copyOfRange(ps, 2, ps.length)); } catch(ClassCastException e) { throw new CalledWithTooManyParameters(); } } } }