Examples of asCollector()


Examples of java.lang.invoke.MethodHandle.asCollector()

    private static void bind(SmalltalkCallSite site, ProtoObject method, Object classModifications, ProtoObject cls, int args) {
        // bind method and class
        MethodHandle target = MethodHandles.insertArguments(APPLY, 1, method, cls);

        // reorder and group arguments
        target = target.asCollector(ProtoObject[].class, args);
        switch (args) {
            case 0: break;
            case 1:
                target = MethodHandles.permuteArguments(target, site.type(), new int[]{0, 2, 1});
                break;
View Full Code Here

Examples of java.lang.invoke.MethodHandle.asCollector()

            e.printStackTrace();
        }

        // This fails too
        try {
            System.out.println(xs.asCollector(String[].class, 2).invokeWithArguments(new TestCollectArguments(), "a",
                    "b", "c"));
        } catch(ClassCastException e) {
            e.printStackTrace();
        }
    }
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.