Examples of TupleSType


Examples of eu.admire.dispel.types.TupleSType

    createSType();
  }

  private void createSType() throws RegistrationFailedException {

    TupleSType tuple = new TupleSType();
    tuple.addElement("s", new PrimitiveSType("String"));
    tuple.addElement("d", new PrimitiveSType("Double"));
    tuple.setRest(true);
    SType listOfTuplesType = new ListSType(tuple);
    SType listOfPrimitiveSType = new ListSType(new PrimitiveSType("Real"));
    SType arrayOfTuplesType = new ArraySType(tuple, 5);
    SType arrayOfPrimitiveSType = new ArraySType(new PrimitiveSType("Real"), 5);
    SType arrayOfAnySType = new ArraySType(new AnySType(), 5);
View Full Code Here

Examples of eu.admire.dispel.types.TupleSType

//    createSType();
  }

  private void createSType() throws RegistrationFailedException {

    TupleSType tuple = new TupleSType();
    tuple.addElement("s", new PrimitiveSType("String"));
    tuple.addElement("d", new PrimitiveSType("Double"));
    tuple.setRest(true);
    SType listOfTuplesType = new ListSType(tuple);
    SType listOfPrimitiveSType = new ListSType(new PrimitiveSType("Real"));
    SType arrayOfTuplesType = new ArraySType(tuple, 5);
    SType arrayOfPrimitiveSType = new ArraySType(new PrimitiveSType("Real"), 5);
    SType arrayOfAnySType = new ArraySType(new AnySType(), 5);
View Full Code Here

Examples of eu.admire.dispel.types.TupleSType

    createSType();
  }
 
  private void createSType() throws RegistrationFailedException {

    TupleSType tuple = new TupleSType();
    tuple.addElement("s", new PrimitiveSType("String"));
    tuple.addElement("d", new PrimitiveSType("Double"));
    tuple.setRest(true);
    SType listOfTuplesType = new ListSType(tuple);
    SType listOfPrimitiveSType = new ListSType(new PrimitiveSType("Real"));
    SType arrayOfTuplesType = new ArraySType(tuple, 5);
    SType arrayOfPrimitiveSType = new ArraySType(new PrimitiveSType("Real"), 5);
    SType arrayOfAnySType = new ArraySType(new AnySType(), 5);
View Full Code Here

Examples of eu.admire.dispel.types.TupleSType

        assertTrue(reg.getObject() instanceof StructuralType);
        stype = ((StructuralType)reg.getObject()).getSType();
        assertTrue(stype instanceof ArraySType);
        assertTrue(((ArraySType)stype).getType() instanceof ListSType);
        assertTrue(((ListSType)((ArraySType)stype).getType()).getChildType() instanceof TupleSType);
        TupleSType tuple = (TupleSType)((ListSType)((ArraySType)stype).getType()).getChildType();
        assertTrue(tuple.getElements().get("a") instanceof ArraySType);
        ArraySType array = (ArraySType)tuple.getElements().get("a");
        assertEquals(3, array.getSize());
        assertTrue(array.getType() instanceof PrimitiveSType);
    }
View Full Code Here

Examples of eu.admire.dispel.types.TupleSType

            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");
View Full Code Here

Examples of eu.admire.dispel.types.TupleSType

    public void testTuple() throws Exception
    {
        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(),
                    null);
        a.setDescriptor(desc);
        ProcessingElementOutputDescriptor outp = new ProcessingElementOutputDescriptor("output");
        t = new TupleSType();
        t.setRest(true);
        outp.setSType(t);
        desc = new SimpleProcessingElementDescriptor(
                    Collections.<ProcessingElementInputDescriptor>emptyList(),
                    Arrays.asList(outp),
                    null);
View Full Code Here

Examples of eu.admire.dispel.types.TupleSType

    public void testTupleIncompatible() throws Exception
    {
        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

Examples of eu.admire.dispel.types.TupleSType

        if (!(stype instanceof ListSType &&
                ((ListSType)stype).getChildType() instanceof TupleSType))
        {
            throw new IllegalArgumentException("Tuple type expected, actual type : " + stype);
        }
        TupleSType tupleType = (TupleSType)((ListSType)stype).getChildType();
        if (tupleType.hasRest())
        {
            throw new UndefinedTupleTypeException(
                    "Cannot construct tuple metadata if SType has rest: "
                    + stype);
        }
        Map<String, SType> elements = tupleType.getElements();
        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>(elements.size());
        for (Entry<String, SType> element : elements.entrySet())
        {
            int type = getTupleType(element.getValue());
            ColumnMetadata column =
View Full Code Here

Examples of eu.admire.dispel.types.TupleSType

        Map<String, Object> tuple = new HashMap<String, Object>();
        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

Examples of eu.admire.dispel.types.TupleSType

        Map<String, Object> tuple = new HashMap<String, Object>();
        tuple.put("a", 10);
        tuple.put("b", "test");
        literal.add(tuple);
        literal.add(ListMarker.END);
        TupleSType stype = new TupleSType();
        stype.setRest(true);
        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
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.