Package org.openquark.gems.client

Examples of org.openquark.gems.client.GemGraph.addGem()


        mapFunctionCollector.setName("mapFunction");
        gemGraph.addGem(mapFunctionCollector);
       
        CollectorGem listCollector = new CollectorGem();
        listCollector.setName("list");
        gemGraph.addGem(listCollector);
       
        // Construct the test for checking whether the 'list' value is the empty list.
        Gem isEmptyGem = gemFactory.makeFunctionalAgentGem(CAL_Prelude.Functions.isEmpty);
        gemGraph.addGem(isEmptyGem);
       
View Full Code Here


        listCollector.setName("list");
        gemGraph.addGem(listCollector);
       
        // Construct the test for checking whether the 'list' value is the empty list.
        Gem isEmptyGem = gemFactory.makeFunctionalAgentGem(CAL_Prelude.Functions.isEmpty);
        gemGraph.addGem(isEmptyGem);
       
        ReflectorGem listReflector1 = new ReflectorGem(listCollector);
        gemGraph.addGem(listReflector1);

        // Construct the gem tree for the case when 'list' is not empty.
View Full Code Here

        // Construct the test for checking whether the 'list' value is the empty list.
        Gem isEmptyGem = gemFactory.makeFunctionalAgentGem(CAL_Prelude.Functions.isEmpty);
        gemGraph.addGem(isEmptyGem);
       
        ReflectorGem listReflector1 = new ReflectorGem(listCollector);
        gemGraph.addGem(listReflector1);

        // Construct the gem tree for the case when 'list' is not empty.
       
        // The head of the returned Cons is: mapFunction (List.head list)
        // which uses the apply gem to apply the mapFunction to its argument.
View Full Code Here

        // The head of the returned Cons is: mapFunction (List.head list)
        // which uses the apply gem to apply the mapFunction to its argument.
        gemGraph.connectGems(listReflector1.getOutputPart(), isEmptyGem.getInputPart(0));

        Gem headGem = gemFactory.makeFunctionalAgentGem(CAL_List.Functions.head);
        gemGraph.addGem(headGem);
       
        ReflectorGem listReflector2 = new ReflectorGem(listCollector);
        gemGraph.addGem(listReflector2);
       
        gemGraph.connectGems(listReflector2.getOutputPart(), headGem.getInputPart(0));
View Full Code Here

        Gem headGem = gemFactory.makeFunctionalAgentGem(CAL_List.Functions.head);
        gemGraph.addGem(headGem);
       
        ReflectorGem listReflector2 = new ReflectorGem(listCollector);
        gemGraph.addGem(listReflector2);
       
        gemGraph.connectGems(listReflector2.getOutputPart(), headGem.getInputPart(0));
       
        Gem applyGem = gemFactory.makeFunctionalAgentGem(CAL_Prelude.Functions.apply);
        gemGraph.addGem(applyGem);
View Full Code Here

        gemGraph.addGem(listReflector2);
       
        gemGraph.connectGems(listReflector2.getOutputPart(), headGem.getInputPart(0));
       
        Gem applyGem = gemFactory.makeFunctionalAgentGem(CAL_Prelude.Functions.apply);
        gemGraph.addGem(applyGem);
       
        ReflectorGem mapFunctionReflector1 = new ReflectorGem(mapFunctionCollector);
        gemGraph.addGem(mapFunctionReflector1);
       
        gemGraph.connectGems(mapFunctionReflector1.getOutputPart(), applyGem.getInputPart(0));
View Full Code Here

       
        Gem applyGem = gemFactory.makeFunctionalAgentGem(CAL_Prelude.Functions.apply);
        gemGraph.addGem(applyGem);
       
        ReflectorGem mapFunctionReflector1 = new ReflectorGem(mapFunctionCollector);
        gemGraph.addGem(mapFunctionReflector1);
       
        gemGraph.connectGems(mapFunctionReflector1.getOutputPart(), applyGem.getInputPart(0));
        gemGraph.connectGems(headGem.getOutputPart(), applyGem.getInputPart(1));
       
        // The tail of the returned Cons is: demoMap mapFunction (List.tail list)
View Full Code Here

        gemGraph.connectGems(mapFunctionReflector1.getOutputPart(), applyGem.getInputPart(0));
        gemGraph.connectGems(headGem.getOutputPart(), applyGem.getInputPart(1));
       
        // The tail of the returned Cons is: demoMap mapFunction (List.tail list)
        Gem tailGem = gemFactory.makeFunctionalAgentGem(CAL_List.Functions.tail);
        gemGraph.addGem(tailGem);

        ReflectorGem listReflector3 = new ReflectorGem(listCollector);
        gemGraph.addGem(listReflector3);
       
        gemGraph.connectGems(listReflector3.getOutputPart(), tailGem.getInputPart(0));
View Full Code Here

        // The tail of the returned Cons is: demoMap mapFunction (List.tail list)
        Gem tailGem = gemFactory.makeFunctionalAgentGem(CAL_List.Functions.tail);
        gemGraph.addGem(tailGem);

        ReflectorGem listReflector3 = new ReflectorGem(listCollector);
        gemGraph.addGem(listReflector3);
       
        gemGraph.connectGems(listReflector3.getOutputPart(), tailGem.getInputPart(0));
       
        ReflectorGem demoMapReflector = new ReflectorGem(gemGraph.getTargetCollector());
        gemGraph.addGem(demoMapReflector);
View Full Code Here

        gemGraph.addGem(listReflector3);
       
        gemGraph.connectGems(listReflector3.getOutputPart(), tailGem.getInputPart(0));
       
        ReflectorGem demoMapReflector = new ReflectorGem(gemGraph.getTargetCollector());
        gemGraph.addGem(demoMapReflector);
       
        ReflectorGem mapFunctionReflector2 = new ReflectorGem(mapFunctionCollector);
        gemGraph.addGem(mapFunctionReflector2);
       
        Gem consGem = gemFactory.makeFunctionalAgentGem(CAL_Prelude.DataConstructors.Cons);
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.