Examples of AviatorJavaType


Examples of com.googlecode.aviator.runtime.type.AviatorJavaType

        SeqPredicateFunction predicate =
                new SeqPredicateFunction("eq_temp_1", OperatorType.EQ, new AviatorString("hello1"));
        Map<String, Object> env = new HashMap<String, Object>();
        env.putAll(AviatorEvaluator.FUNC_MAP);
        env.put("eq_temp_1", predicate);
        args[1] = new AviatorJavaType("eq_temp_1");
        SeqFilterFunction fun = new SeqFilterFunction();
        AviatorObject result = fun.call(env, args);
        LinkedList list = (LinkedList) result.getValue(null);
        assertEquals(1, list.size());
        for (Object i : list) {
View Full Code Here

Examples of com.googlecode.aviator.runtime.type.AviatorJavaType

    @Test(expected = IllegalArgumentException.class)
    public void testFilter_String() {
        AviatorObject[] args = new AviatorObject[2];

        args[0] = new AviatorRuntimeJavaType("hello");
        args[1] = new AviatorJavaType("string.length");
        SeqFilterFunction fun = new SeqFilterFunction();

        AviatorObject result = fun.call(AviatorEvaluator.FUNC_MAP, args);
    }
View Full Code Here

Examples of com.googlecode.aviator.runtime.type.AviatorJavaType

        final String[] strs = new String[10];
        for (int i = 0; i < strs.length; i++) {
            strs[i] = "hello";
        }
        args[0] = new AviatorRuntimeJavaType(strs);
        args[1] = new AviatorJavaType("string.length");
        SeqMapFunction fun = new SeqMapFunction();
        AviatorObject result = fun.call(AviatorEvaluator.FUNC_MAP, args);
        Object[] array = (Object[]) result.getValue(null);
        for (Object i : array) {
            assertEquals(5, i);
View Full Code Here

Examples of com.googlecode.aviator.runtime.type.AviatorJavaType

        final List<String> strs = new LinkedList<String>();
        for (int i = 0; i < 10; i++) {
            strs.add("hello");
        }
        args[0] = new AviatorRuntimeJavaType(strs);
        args[1] = new AviatorJavaType("string.length");
        SeqMapFunction fun = new SeqMapFunction();
        AviatorObject result = fun.call(AviatorEvaluator.FUNC_MAP, args);
        LinkedList array = (LinkedList) result.getValue(null);
        for (Object i : array) {
            assertEquals(5, i);
View Full Code Here

Examples of com.googlecode.aviator.runtime.type.AviatorJavaType

    @Test(expected = IllegalArgumentException.class)
    public void testMap_String() {
        AviatorObject[] args = new AviatorObject[2];

        args[0] = new AviatorRuntimeJavaType("hello");
        args[1] = new AviatorJavaType("string.length");
        SeqMapFunction fun = new SeqMapFunction();

        AviatorObject result = fun.call(AviatorEvaluator.FUNC_MAP, args);
    }
View Full Code Here

Examples of com.googlecode.aviator.runtime.type.AviatorJavaType

        Map<String, Object> env = new HashMap<String, Object>();
        env.put("a", 400);
        env.put("b", 9.0);

        assertEquals(5.991, this.function.call(env, new AviatorJavaType("a")).getValue(null));
        assertEquals(2.197, this.function.call(env, new AviatorJavaType("b")).getValue(null));
    }
View Full Code Here

Examples of com.googlecode.aviator.runtime.type.AviatorJavaType

        Map<String, Object> env = new HashMap<String, Object>();
        env.put("a", 10000);
        env.put("b", 9.0);

        assertEquals(Math.sin(10000), this.function.call(env, new AviatorJavaType("a")).getValue(null));
        assertEquals(Math.sin(9.0), this.function.call(env, new AviatorJavaType("b")).getValue(null));
    }
View Full Code Here

Examples of com.googlecode.aviator.runtime.type.AviatorJavaType

            a[i] = i;
        }

        AviatorObject[] args = new AviatorObject[3];
        args[0] = new AviatorRuntimeJavaType(a);
        args[1] = new AviatorJavaType("+");
        args[2] = new AviatorRuntimeJavaType(0);

        SeqReduceFunction fun = new SeqReduceFunction();
        AviatorObject result = fun.call(AviatorEvaluator.FUNC_MAP, args);
        assertNotNull(result);
View Full Code Here

Examples of com.googlecode.aviator.runtime.type.AviatorJavaType

            }
        }

        AviatorObject[] args = new AviatorObject[3];
        args[0] = new AviatorRuntimeJavaType(a);
        args[1] = new AviatorJavaType("+");
        args[2] = new AviatorRuntimeJavaType(0);

        SeqReduceFunction fun = new SeqReduceFunction();
        AviatorObject result = fun.call(AviatorEvaluator.FUNC_MAP, args);
View Full Code Here

Examples of com.googlecode.aviator.runtime.type.AviatorJavaType

            a.add(i);
        }

        AviatorObject[] args = new AviatorObject[3];
        args[0] = new AviatorRuntimeJavaType(a);
        args[1] = new AviatorJavaType("+");
        args[2] = new AviatorRuntimeJavaType(0);

        SeqReduceFunction fun = new SeqReduceFunction();
        AviatorObject result = fun.call(AviatorEvaluator.FUNC_MAP, args);
        assertNotNull(result);
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.