Examples of AviatorRuntimeJavaType


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

        AviatorObject[] args = new AviatorObject[2];
        final String[] strs = new String[10];
        for (int i = 0; i < strs.length; i++) {
            strs[i] = "hello" + i;
        }
        args[0] = new AviatorRuntimeJavaType(strs);
        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);
View Full Code Here

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

        AviatorObject[] args = new AviatorObject[2];
        final List<String> strs = new LinkedList<String>();
        for (int i = 0; i < 10; i++) {
            strs.add("hello" + i);
        }
        args[0] = new AviatorRuntimeJavaType(strs);
        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);
View Full Code Here

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

    @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.AviatorRuntimeJavaType

        AviatorObject[] args = new AviatorObject[2];
        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) {
View Full Code Here

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

        AviatorObject[] args = new AviatorObject[2];
        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) {
View Full Code Here

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

    @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.AviatorRuntimeJavaType

        for (int i = 0; i < a.length; i++) {
            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);
        assertEquals(45, result.getValue(null));
View Full Code Here

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

                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);

    }
View Full Code Here

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

        for (int i = 0; i < 10; i++) {
            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);
        assertEquals(45, result.getValue(null));
View Full Code Here

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

        for (int i = 0; i < 10; i++) {
            a.add(i);
        }

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

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