AFC - Abacus Formula Compiler for Java

Decompiled Code For CHOOSE( C143, D143, E143, F143 )

The expression

=CHOOSE( C143, D143, E143, F143 )

is compiled to the following class(es):

package org.formulacompiler.gen;
import org.formulacompiler.runtime.Computation;
import org.formulacompiler.runtime.internal.Environment;
import org.formulacompiler.runtime.internal.Runtime_v2;
import org.formulacompiler.tests.reference.base.Inputs;
import org.formulacompiler.tests.reference.base.Outputs;

final class $Root extends Outputs implements Computation
{
    private final Inputs $inputs;
    final Environment $environment;

    $Root(Inputs inputs, Environment environment) {
        $environment = environment;
        $inputs = inputs;
    }

    final double get$0() {
        return get$5();
    }

    public final double dbl() {
        return get$0();
    }

    final double get$5() {
        switch ((int) Runtime_v2.checkDouble(get$1())) {
        case 1:
            return get$2();
        case 2:
            return get$3();
        case 3:
            return get$4();
        default:
            Runtime_v2
                .fun_ERROR("#VALUE! because index to CHOOSE is out of range");
            return (double) -1;
        }
    }

    final double get$1() {
        return $inputs.dbl(0);
    }

    final double get$2() {
        return $inputs.dbl(1);
    }

    final double get$3() {
        return $inputs.dbl(2);
    }

    final double get$4() {
        return $inputs.dbl(3);
    }
}