Examples of ArithmeticNode


Examples of org.codehaus.preon.el.ast.ArithmeticNode

    @SuppressWarnings("unchecked")
    @Test
    public void testJustArithmetic() {
        Node<Integer,?> a = new IntegerNode(12);
        Node<Integer,?> b = new IntegerNode(13);
        Node<Integer,?> expr = new ArithmeticNode(Operator.plus, a, b);
        assertEquals(25, expr.eval(null).intValue());
    }
View Full Code Here

Examples of org.codehaus.preon.el.ast.ArithmeticNode

    public void testCompound() {
        Node<Integer,?> a = new IntegerNode(12);
        Node<Integer,?> b = new IntegerNode(13);
        Node<Integer,?> c = new IntegerNode(14);
        Node<Integer,?> d = new IntegerNode(15);
        Node<Integer,?> expr1 = new ArithmeticNode(Operator.plus, a, b);
        Node<Integer,?> expr2 = new ArithmeticNode(Operator.minus, c, d);
        Node<Boolean,?> expr = new RelationalNode(Relation.GT, expr1, expr2);
        assertEquals(true, expr.eval(null).booleanValue());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.