AFC - Abacus Formula Compiler for Java

Decompiled Code For DSUM( B2:E8, D28, B10:D12 )

The expression

=DSUM( B2:E8, D28, B10:D12 )

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$12(get$10(), get$11());
    }

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

    final double get$12(String string, String string_0_) {
        double d = 0.0;
        switch ((int) Runtime_v2.checkDouble(get$9())) {
        case 2:
            if (get$13(get$1(), get$2(), string, string_0_))
                d += get$2();
            if (get$13(get$5(), get$6(), string, string_0_))
                d += get$6();
            if (get$13("Cherry", 13.0, string, string_0_))
                d += 13.0;
            if (get$13("Apple", 14.0, string, string_0_))
                d += 14.0;
            if (get$13("Pear", 9.0, string, string_0_))
                d += 9.0;
            if (get$13("Apple", 8.0, string, string_0_))
                d += 8.0;
            break;
        case 3:
            if (get$13(get$1(), get$2(), string, string_0_))
                d += get$3();
            if (get$13(get$5(), get$6(), string, string_0_))
                d += get$7();
            if (get$13("Cherry", 13.0, string, string_0_))
                d += 9.0;
            if (get$13("Apple", 14.0, string, string_0_))
                d += 10.0;
            if (get$13("Pear", 9.0, string, string_0_))
                d += 8.0;
            if (get$13("Apple", 8.0, string, string_0_))
                d += 6.0;
            break;
        case 4:
            if (get$13(get$1(), get$2(), string, string_0_))
                d += get$4();
            if (get$13(get$5(), get$6(), string, string_0_))
                d += get$8();
            if (get$13("Cherry", 13.0, string, string_0_))
                d += 105.0;
            if (get$13("Apple", 14.0, string, string_0_))
                d += 75.0;
            if (get$13("Pear", 9.0, string, string_0_))
                d += 76.8;
            if (get$13("Apple", 8.0, string, string_0_))
                d += 45.0;
            break;
        default:
            return 0.0;
        }
        return d;
    }

    final boolean get$13(String string, double d, String string_1_,
                         String string_2_) {
        if (string.equalsIgnoreCase(string_1_) && d > 10.0 && !(d >= 16.0)
            || string.equalsIgnoreCase(string_2_) &#38;&#38; d < 1000.0)
            return true;
        return false;
    }

    final String get$1() {
        return Runtime_v2.stringFromString($inputs.str(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);
    }

    final String get$5() {
        return Runtime_v2.stringFromString($inputs.str(4));
    }

    final double get$6() {
        return $inputs.dbl(5);
    }

    final double get$7() {
        return $inputs.dbl(6);
    }

    final double get$8() {
        return $inputs.dbl(7);
    }

    final double get$9() {
        return $inputs.dbl(10);
    }

    final String get$10() {
        return Runtime_v2.stringFromString($inputs.str(8));
    }

    final String get$11() {
        return Runtime_v2.stringFromString($inputs.str(9));
    }
}