Examples of CodeGem


Examples of org.openquark.gems.client.CodeGem

            // Create a code gem to extract the ith property from the message list input
            // e.g. the code gem for the 5th message property would be:
            // List.map (\msg -> msg.#5) msg
            // which takes the input list of message tuples as input, and outputs a new list
            // containing the 5th element of every message.
            Gem propertyExtractorGem = new CodeGem(codeAnalyser, CAL_List.Functions.map.getQualifiedName() + " (\\msg -> msg.#" + ++i +") msg", Collections.<String>emptySet());
            gemGraph.addGem(propertyExtractorGem);
                    
            // create the collector gem for this message property
            CollectorGem propertyGem = new CollectorGem ();
            propertyGem.setName (makeCollectorName (propertyInfo.name));  
            gemGraph.addGem(propertyGem);
           
            gemGraph.connectGems(messageReflector.getOutputPart(), propertyExtractorGem.getInputPart(0));   
            gemGraph.connectGems(propertyExtractorGem.getOutputPart(), propertyGem.getInputPart(0));   

            bindingContext.addCollector(propertyInfo, propertyGem);
           
            assert graphIsValid() : gemGraph.toString();
        }
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.