AFC - Abacus Formula Compiler for Java

Decompiled Code For DCOUNTA( B2:E8, "Profit", B10:D12 )

The expression

=DCOUNTA( B2:E8, "Profit", 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.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$1();
    }

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

    final double get$1() {
        int i = 0;
        if (get$2("Apple", 18.0))
            i++;
        if (get$2("Pear", 12.0))
            i++;
        if (get$2("Cherry", 13.0))
            i++;
        if (get$2("Apple", 14.0))
            i++;
        if (get$2("Pear", 9.0))
            i++;
        if (get$2("Apple", 8.0))
            i++;
        return i <= 0 ? 0.0 : (double) i;
    }

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