Package uk.org.ogsadai.tuple

Examples of uk.org.ogsadai.tuple.TupleMetadata


       
        MockInputPipe inputTemplate = new MockInputPipe("Hello $REPLACE(A)$, hello $REPLACE(B)$!");
       
        ColumnMetadata colA = new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0);
        ColumnMetadata colB = new SimpleColumnMetadata("B", TupleTypes._DOUBLE, 0, 0, 0);
        TupleMetadata metadata = new SimpleTupleMetadata(Arrays.asList(colA, colB));
        Tuple tuple1 = new SimpleTuple(Arrays.<Object>asList("Amy", 0));
        Tuple tuple2 = new SimpleTuple(Arrays.<Object>asList("Ally", 1.0));
        Tuple tuple3 = new SimpleTuple(Arrays.<Object>asList("Radek", 2.0));
        MockInputPipe inputData = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
View Full Code Here


    {
       
        MockInputPipe inputTemplate = new MockInputPipe("Hello $REPLACE(A)$, hello $REPLACE(B)$!");
       
        ColumnMetadata colA = new SimpleColumnMetadata("A", TupleTypes._STRING, 0, 0, 0);
        TupleMetadata metadata = new SimpleTupleMetadata(Arrays.asList(colA));
        Tuple tuple1 = new SimpleTuple(Arrays.<Object>asList("Amy", 0));
        Tuple tuple2 = new SimpleTuple(Arrays.<Object>asList("Ally", 1.0));
        Tuple tuple3 = new SimpleTuple(Arrays.<Object>asList("Radek", 2.0));
        MockInputPipe inputData = new MockInputPipe(new Object[] {
                ControlBlock.LIST_BEGIN,
View Full Code Here

        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        for (int i=0; i<mModifiers.length; i++)
        {
            columns.add(mModifiers[i].getColumnMetadata());
        }
        TupleMetadata md = new SimpleTupleMetadata(columns);
        return new MetadataWrapper(md);
    }
View Full Code Here

    protected void processIteration(Object[] iterationData)
            throws ActivityProcessingException, ActivityTerminatedException,
            ActivityUserException
    {
        TupleListIterator tuples = (TupleListIterator)iterationData[0];
        TupleMetadata metadata =
            (TupleMetadata)tuples.getMetadataWrapper().getMetadata();
        Tuple tuple;
        Mean[] calc = getMeanCalculator(metadata);
        while ((tuple = (Tuple)tuples.nextValue()) != null)
        {
View Full Code Here

                        0,
                        ColumnMetadata.COLUMN_NULLABLE,
                        0);
            cols.add(column);
        }
        TupleMetadata result = new SimpleTupleMetadata(cols);
        return result;
    }
View Full Code Here

      ActivityTerminatedException, ActivityUserException {
    FullListTupleListIterator items = new FullListTupleListIterator(INPUT_ITEMS, mItems);
    TupleListIterator customers = new FullListTupleListIterator(INPUT_TRANSACTIONS, mTransactions);
    Integer keyIndex= getKeyIndex();
   
    TupleMetadata metadata = prepareMetadata(items);
   
   
    try {
   
        mOutput.write(ControlBlock.LIST_BEGIN);
View Full Code Here

        columns.add(new SimpleColumnMetadata(item.getString(1), TupleTypes._STRING,
                    0,
                    ColumnMetadata.COLUMN_NO_NULLS,
                    0));       
      }
      TupleMetadata metadata = new SimpleTupleMetadata(columns);
    return metadata;
    }
View Full Code Here

       
        classify.process();
       
        List<?> actualBlocks = outputClassify.getActualBlocks();
        assertEquals(input.size(), actualBlocks.size());
        TupleMetadata tupleMetadata = (TupleMetadata)((MetadataWrapper)actualBlocks.get(1)).getMetadata();
        assertEquals("myResult", tupleMetadata.getColumnMetadata(0).getName());
        assertEquals(ControlBlock.LIST_BEGIN, actualBlocks.get(0));
        for (int i=2; i<actualBlocks.size()-1; i++)
        {
            assertEquals("Unexpected class",
                    ((Tuple)input.get(i)).getString(4),
View Full Code Here

       
        classify.process();
       
        List<?> actualBlocks = outputClassify.getActualBlocks();
        assertEquals(input.size(), actualBlocks.size());
        TupleMetadata tupleMetadata = (TupleMetadata)((MetadataWrapper)actualBlocks.get(1)).getMetadata();
        assertEquals("myResult", tupleMetadata.getColumnMetadata(0).getName());
        assertEquals(ControlBlock.LIST_BEGIN, actualBlocks.get(0));
        for (int i=2; i<actualBlocks.size()-1; i++)
        {
            assertEquals("Unexpected class",
                    ((Tuple)input.get(i)).getString(4),
View Full Code Here

        List<ColumnMetadata> columns = new ArrayList<ColumnMetadata>();
        ColumnMetadata column = new SimpleColumnMetadata("class", TupleTypes._STRING, 0, 0, 0);
        columns.add(column);
        column = new SimpleColumnMetadata("date", TupleTypes._DATE, 0, 0, 0);
        columns.add(column);
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        List<Object> table = new ArrayList<Object>();
        table.add(ControlBlock.LIST_BEGIN);
        table.add(new MetadataWrapper(metadata));
        SimpleDateFormat format = new SimpleDateFormat(WekaUtilities.DATE_FORMAT);
        table.add(new SimpleTuple(Arrays.asList("yes", format.parse("2009-01-01T10:00:00"))));
View Full Code Here

TOP

Related Classes of uk.org.ogsadai.tuple.TupleMetadata

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.