Package org.apache.poi.ss.formula.eval

Examples of org.apache.poi.ss.formula.eval.ValueEval


        ValueEval[] args = new ValueEval[]{new StringEval(number1),};
        return new Code().evaluate(args, -1, -1);
    }

    private static void confirmValue(String msg, String number1, String expected) {
        ValueEval result = invokeValue(number1);
        assertEquals(StringEval.class, result.getClass());
        assertEquals(msg, expected, ((StringEval) result).getStringValue());
    }
View Full Code Here


        assertEquals(StringEval.class, result.getClass());
        assertEquals(msg, expected, ((StringEval) result).getStringValue());
    }

    private static void confirmValueError(String msg, String number1, ErrorEval numError) {
        ValueEval result = invokeValue(number1);
        assertEquals(ErrorEval.class, result.getClass());
        assertEquals(msg, numError, result);
    }
View Full Code Here

    ValueEval[] args = new ValueEval[] { new StringEval(number1) };
    return new Hex2Dec().evaluate(args, -1, -1);
  }

    private static void confirmValue(String msg, String number1, String expected) {
    ValueEval result = invokeValue(number1);
    assertEquals(NumberEval.class, result.getClass());
    assertEquals(msg, expected, ((NumberEval) result).getStringValue());
  }
View Full Code Here

    assertEquals(NumberEval.class, result.getClass());
    assertEquals(msg, expected, ((NumberEval) result).getStringValue());
  }

    private static void confirmValueError(String msg, String number1, ErrorEval numError) {
        ValueEval result = invokeValue(number1);
        assertEquals(ErrorEval.class, result.getClass());
        assertEquals(msg, numError, result);
    }
View Full Code Here

        ValueEval[] args2 = { aeA, percentile };
        return AggregateFunction.PERCENTILE.evaluate(args2, -1, -1);
    }

    private void confirmPercentile(ValueEval percentile, ValueEval[] args, double expected) {
        ValueEval result = invokePercentile(args, percentile);
        assertEquals(NumberEval.class, result.getClass());
        double delta = 0.00000001;
        assertEquals(expected, ((NumberEval) result).getNumberValue(), delta);
    }
View Full Code Here

        double delta = 0.00000001;
        assertEquals(expected, ((NumberEval) result).getNumberValue(), delta);
    }

    private void confirmPercentile(ValueEval percentile, ValueEval[] args, ErrorEval expectedError) {
        ValueEval result = invokePercentile(args, percentile);
        assertEquals(ErrorEval.class, result.getClass());
        assertEquals(expectedError.getErrorCode(), ((ErrorEval) result).getErrorCode());
    }
View Full Code Here

    }

    public void testBasic() {
        ValueEval[] values = { new NumberEval(210.128), new NumberEval(65.2182), new NumberEval(32.231),
                new NumberEval(12.123), new NumberEval(45.32) };
        ValueEval percentile = new NumberEval(0.95);
        confirmPercentile(percentile, values, 181.14604);
    }
View Full Code Here

    }

    public void testBlanks() {
        ValueEval[] values = { new NumberEval(210.128), new NumberEval(65.2182), new NumberEval(32.231),
                BlankEval.instance, new NumberEval(45.32) };
        ValueEval percentile = new NumberEval(0.95);
        confirmPercentile(percentile, values, 188.39153);
    }
View Full Code Here

        confirmPercentile(percentile, values, 188.39153);
    }

    public void testUnusualArgs() {
        ValueEval[] values = { new NumberEval(1), new NumberEval(2), BoolEval.TRUE, BoolEval.FALSE };
        ValueEval percentile = new NumberEval(0.95);
        confirmPercentile(percentile, values, 1.95);
    }
View Full Code Here

    }

    //percentile has to be between 0 and 1 - here we test less than zero
    public void testUnusualArgs2() {
        ValueEval[] values = { new NumberEval(1), new NumberEval(2), };
        ValueEval percentile = new NumberEval(-0.1);
        confirmPercentile(percentile, values, ErrorEval.NUM_ERROR);
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.formula.eval.ValueEval

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.