Package eu.admire.dispel.types

Examples of eu.admire.dispel.types.PrimitiveSType


    public void testConnectionWithSType() throws Exception
    {
        DispelObject object = new DispelObject(
                "MySType",
                DispelObjectType.STRUCTURAL_TYPE,
                new StructuralType(new ListSType(new PrimitiveSType("Integer"))));
        mRegistry.register("MySType", object);
        runDISPEL("use MySType; Connection c; |- [1] -|::[MySType] => c; ");
        assertNull(mError);
    }
View Full Code Here


    public void testConnectionWithAnnotation() throws Exception
    {
        DispelObject object = new DispelObject(
                "MySType",
                DispelObjectType.STRUCTURAL_TYPE,
                new StructuralType(new ListSType(new PrimitiveSType("Integer"))));
        mRegistry.register("MySType", object);
        DISPELGraphBuilder builder =
            runDISPEL("use a.A; A a1 = new A; A a2 = new A;\n" +
            "a1.output => a2.input with @bli=\"bla\"; " +
            "Connection c;" +
View Full Code Here

    public void testMultipleInputsWithTypes() throws Exception
    {
        List<ProcessingElementInputDescriptor> inputDescriptors =
            new ArrayList<ProcessingElementInputDescriptor>();
        ProcessingElementInputDescriptor inputDesc = new ProcessingElementInputDescriptor("in1");
        inputDesc.setSType(new PrimitiveSType("mytype"));
        inputDescriptors.add(inputDesc);
        inputDesc = new ProcessingElementInputDescriptor("in2");
        TupleSType tuple = new TupleSType();
        tuple.addElement("a", new PrimitiveSType("Integer"));
        tuple.addElement("b", new PrimitiveSType("String"));
        tuple.setRest(true);
        inputDesc.setSType(tuple);
        inputDescriptors.add(inputDesc);
        List<ProcessingElementOutputDescriptor> outputDescriptors =
            new ArrayList<ProcessingElementOutputDescriptor>();
        ProcessingElementOutputDescriptor outputDesc = new ProcessingElementOutputDescriptor("in1");
        outputDesc.setSType(new PrimitiveSType("mytype"));
        outputDescriptors.add(outputDesc);
        outputDesc = new ProcessingElementOutputDescriptor("out1");
        ListSType list = new ListSType(new ListSType(new PrimitiveSType("Real")));
        outputDesc.setSType(list);
        outputDescriptors.add(outputDesc);
        ProcessingElementDescriptor desc =
            new SimpleProcessingElementDescriptor(inputDescriptors, outputDescriptors, null);
View Full Code Here

    {
        ProcessingElementNode a = new ProcessingElementNode("A");
        ProcessingElementNode b = new ProcessingElementNode("B");
        ProcessingElementInputDescriptor inp = new ProcessingElementInputDescriptor("input");
        TupleSType t = new TupleSType();
        t.addElement("el1", new PrimitiveSType("String"));
        t.addElement("el2", new PrimitiveSType("Integer"));
        inp.setSType(t);
        ProcessingElementDescriptor desc =
            new SimpleProcessingElementDescriptor(
                    Arrays.asList(inp),
                    Collections.<ProcessingElementOutputDescriptor>emptyList(),
View Full Code Here

    {
        ProcessingElementNode a = new ProcessingElementNode("A");
        ProcessingElementNode b = new ProcessingElementNode("B");
        ProcessingElementInputDescriptor inp = new ProcessingElementInputDescriptor("input");
        TupleSType t = new TupleSType();
        t.addElement("a", new PrimitiveSType("String"));
        inp.setSType(t);
        ProcessingElementDescriptor desc =
            new SimpleProcessingElementDescriptor(
                    Arrays.asList(inp),
                    Collections.<ProcessingElementOutputDescriptor>emptyList(),
                    null);
        a.setDescriptor(desc);
        ProcessingElementOutputDescriptor outp = new ProcessingElementOutputDescriptor("output");
        t = new TupleSType();
        t.addElement("b", new PrimitiveSType("String"));
        outp.setSType(t);
        desc = new SimpleProcessingElementDescriptor(
                    Collections.<ProcessingElementInputDescriptor>emptyList(),
                    Arrays.asList(outp),
                    null);
View Full Code Here

                "Unsupported object type: " + object.getClass().getName());
    }

    public static int getTupleType(SType type)
    {
        PrimitiveSType primitive = (PrimitiveSType)type;
        if (primitive.getName().equals("String"))
        {
            return TupleTypes._STRING;
        }
        if (primitive.getName().equals("Integer"))
        {
            return TupleTypes._LONG;
        }
        if (primitive.getName().equals("Real"))
        {
            return TupleTypes._DOUBLE;
        }
        throw new IllegalArgumentException("Unsupported SType: " + type);
    }
View Full Code Here

        tuple.put("a", 10);
        tuple.put("b", "test");
        literal.add(tuple);
        literal.add(ListMarker.END);
        TupleSType stype = new TupleSType();
        stype.addElement("a", new PrimitiveSType("Integer"));
        stype.addElement("b", new PrimitiveSType("String"));
        literal.setOutputDescriptor(new ListSType(stype), null);
        ProcessingElementNode node2 = new ProcessingElementNode("2");
        node2.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        literal.connectOutput("output", 0, node2.getInput("input", 0));
        Graph graph = new Graph();
View Full Code Here

    ProcessingElementInputDescriptor peInDescr1 = new ProcessingElementInputDescriptor(
        "unionInput1");
    ProcessingElementInputDescriptor peInDescr2 = new ProcessingElementInputDescriptor(
        "unionInput2");
    peInDescr1.setArray(false);
    SType sTypeIn1 = new PrimitiveSType("any");
    SType sTypeIn2 = new PrimitiveSType("Array");
    DType dtypeIn1 = new SimpleDType("DummyInputDType1");
    DType dtypeIn2 = new SimpleDType("DummyInputDType2");
    peInDescr1.setSType(sTypeIn1);
    peInDescr1.setDType(dtypeIn1);
    peInDescr2.setSType(sTypeIn1);
    peInDescr2.setDType(dtypeIn2);

    inputs.add(peInDescr1);
    inputs.add(peInDescr2);

    ProcessingElementOutputDescriptor peOutDescr1 = new ProcessingElementOutputDescriptor(
        "dummyOutput");
    ProcessingElementOutputDescriptor peOutDescr2 = new ProcessingElementOutputDescriptor(
        "dummyOutput2");
    SType sTypeOut1 = new PrimitiveSType("DummyOutputST1");
    SType sTypeOut2 = new PrimitiveSType("DummyOutputST2");
    DType dtypeOut1 = new SimpleDType("DummyOutputDType1");
    DType dtypeOut2 = new SimpleDType("DummyOutputDType2");
    peOutDescr1.setSType(sTypeOut1);
    peOutDescr1.setDType(dtypeOut1);
//    peOutDescr2.setSType(sTypeOut2);
View Full Code Here

        "peInDescr1");
    ProcessingElementInputDescriptor peInDescr2 = new ProcessingElementInputDescriptor(
        "resource", true);
    peInDescr1.setArray(false);
    TupleSType sTypeIn1 = new TupleSType();
    sTypeIn1.addElement("a", new PrimitiveSType("primitiveSTypeDummyTestA"));
    sTypeIn1.addElement("b", new PrimitiveSType("primitiveSTypeDummyTestB"));
    SType sTypeIn2 = new PrimitiveSType("locator");
    peInDescr1.setSType(sTypeIn2);
    peInDescr2.setSType(sTypeIn1);

    inputs.add(peInDescr1);
    inputs.add(peInDescr2);

    ProcessingElementOutputDescriptor peOutDescr1 = new ProcessingElementOutputDescriptor(
    "data");
    SType sTypeOut1 = new PrimitiveSType("DummyOutputST1");
//    SType sTypeOut2 = new PrimitiveSType("DummyOutputST2");
    DType dtypeOut1 = new SimpleDType("DummyOutputDType1");
//    DType dtypeOut2 = new SimpleDType("DummyOutputDType2");
    peOutDescr1.setSType(sTypeOut1);
    peOutDescr1.setDType(dtypeOut1);
View Full Code Here

        "peInDescr1");
    ProcessingElementInputDescriptor peInDescr2 = new ProcessingElementInputDescriptor(
        "resource", true);
    peInDescr1.setArray(false);
    TupleSType tupleList1 = new TupleSType();
    tupleList1.addElement("a", new PrimitiveSType("primitiveTupleListST"));
    ListSType sTypeIn1 = new ListSType(tupleList1);
    SType sTypeIn2 = new PrimitiveSType("locator");
    peInDescr1.setSType(sTypeIn2);
    peInDescr2.setSType(sTypeIn1);

    inputs.add(peInDescr1);
    inputs.add(peInDescr2);

    ProcessingElementOutputDescriptor peOutDescr1 = new ProcessingElementOutputDescriptor(
        "data");
    SType sTypeOut1 = new PrimitiveSType("DummyOutputST1");
    // SType sTypeOut2 = new PrimitiveSType("DummyOutputST2");
    DType dtypeOut1 = new SimpleDType("DummyOutputDType1");
    // DType dtypeOut2 = new SimpleDType("DummyOutputDType2");
    peOutDescr1.setSType(sTypeOut1);
    peOutDescr1.setDType(dtypeOut1);
View Full Code Here

TOP

Related Classes of eu.admire.dispel.types.PrimitiveSType

Copyright © 2018 www.massapicom. 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.