Package uk.org.ogsadai.tuple

Examples of uk.org.ogsadai.tuple.SimpleTuple


     * @return a newly created tuple
     */
    private Tuple createTuple(Object[] values) {
       
        List<Object> list = Arrays.asList(values);
        return new SimpleTuple(list);
    }
View Full Code Here


      if(index!=prevIndex) {

                List<Object> elements = new ArrayList<Object>();
                for(int i=0;i<tmpList.length;i++)
                  elements.add(tmpList[i]);
                mOutput.write(new SimpleTuple(elements));
               
       
      }
      prevIndex = index;
      }
View Full Code Here

        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"))));
        table.add(new SimpleTuple(Arrays.asList("yes", format.parse("2009-01-01T12:34:00"))));
        table.add(new SimpleTuple(Arrays.asList("no", format.parse("2008-02-01T09:00:00"))));
        table.add(new SimpleTuple(Arrays.asList("no", format.parse("2008-02-03T22:00:00"))));
        table.add(ControlBlock.LIST_END);

        BuildClassifierActivity activity = new BuildClassifierActivity();
        KeyValueProperties properties = new SimpleKeyValueProperties();
        properties.put(
View Full Code Here

        columns.add(column);
        TupleMetadata metadata = new SimpleTupleMetadata(columns);
        List<Object> table = new ArrayList<Object>();
        table.add(ControlBlock.LIST_BEGIN);
        table.add(new MetadataWrapper(metadata));
        table.add(new SimpleTuple(Arrays.asList(2, 3)));
        table.add(new SimpleTuple(Arrays.asList(2, 4)));
        table.add(new SimpleTuple(Arrays.asList(1, 1)));
        table.add(new SimpleTuple(Arrays.asList(1, 2)));
        table.add(ControlBlock.LIST_END);

        BuildClassifierActivity activity = new BuildClassifierActivity();
        KeyValueProperties properties = new SimpleKeyValueProperties();
        properties.put(
View Full Code Here

     
        List<Object> result = new ArrayList<Object>();
     
        result.add(ControlBlock.LIST_BEGIN);
        result.add(new MetadataWrapper(metadata));
        result.add(new SimpleTuple(Arrays.asList("sunny", "false", 85, 85, "no")));
        result.add(new SimpleTuple(Arrays.asList("sunny", "true", 80, 90, "no")));
        result.add(new SimpleTuple(Arrays.asList("overcast", "false", 83, 78, "yes")));
        result.add(new SimpleTuple(Arrays.asList("rain", "false", 70, 96, "yes")));
        result.add(new SimpleTuple(Arrays.asList("rain", "false", 68, 80, "yes")));
        result.add(new SimpleTuple(Arrays.asList("rain", "true", 65, 70, "no")));
        result.add(new SimpleTuple(Arrays.asList("overcast", "true", 64, 65, "yes")));
        result.add(new SimpleTuple(Arrays.asList("sunny", "false", 72, 95, "no")));
        result.add(new SimpleTuple(Arrays.asList("sunny", "false", 69, 70, "yes")));
        result.add(new SimpleTuple(Arrays.asList("rain", "false", 75, 80, "yes")));
        result.add(new SimpleTuple(Arrays.asList("sunny", "true", 75, 70, "yes")));
        result.add(new SimpleTuple(Arrays.asList("overcast", "true", 72, 90, "yes")));
        result.add(new SimpleTuple(Arrays.asList("overcast", "false", 81, 75, "yes")));
        result.add(new SimpleTuple(Arrays.asList("rain", "true", 71, 91, "no")));
        result.add(ControlBlock.LIST_END);
     
        return result;

    }
View Full Code Here

     
        List<Object> result = new ArrayList<Object>();
     
        result.add(ControlBlock.LIST_BEGIN);
        result.add(new MetadataWrapper(metadata));
        result.add(new SimpleTuple(Arrays.asList("sunny", "false", 85, 85, "no")));
        result.add(new SimpleTuple(Arrays.asList("sunny", "true", 80, 90, "no")));
        result.add(new SimpleTuple(Arrays.asList("overcast", "false", 83, 78, "yes")));
        result.add(new SimpleTuple(Arrays.asList("rain", "false", 70, 96, "yes")));
        result.add(new SimpleTuple(Arrays.asList("rain", "false", 68, 80, "yes")));
        result.add(new SimpleTuple(Arrays.asList("rain", "true", 65, 70, "no")));
        result.add(new SimpleTuple(Arrays.asList("overcast", "true", 64, 65, "yes")));
        result.add(new SimpleTuple(Arrays.asList("sunny", "false", 72, 95, "no")));
        result.add(new SimpleTuple(Arrays.asList("sunny", "false", 69, 70, "yes")));
        result.add(new SimpleTuple(Arrays.asList("rain", "false", 75, 80, "yes")));
        result.add(new SimpleTuple(Arrays.asList("sunny", "true", 75, 70, "yes")));
        result.add(new SimpleTuple(Arrays.asList("overcast", "true", 72, 90, "yes")));
        result.add(new SimpleTuple(Arrays.asList("overcast", "false", 81, 75, "yes")));
        result.add(new SimpleTuple(Arrays.asList("rain", "true", 71, 91, "no")));
        result.add(ControlBlock.LIST_END);
     
        return result;

    }
View Full Code Here

       
        ConversionActivity activity = new ConversionActivity();
        MockInputPipe input = new MockInputPipe( new Object[] {
                ControlBlock.LIST_BEGIN,
                new MetadataWrapper(metadata),
                new SimpleTuple(Arrays.asList(new Object[] {1, "30"})),
                new SimpleTuple(Arrays.asList(new Object[] {1, "90"})),
                new SimpleTuple(Arrays.asList(new Object[] {2, "10 20"})),
                ControlBlock.LIST_END
        });
       
        MockOutputPipe output = new MockOutputPipe(new Object[] {});
        activity.addInput("data", input);
View Full Code Here

            ActivityUserException
    {
        String data = (String) iterationData[0];
        List elements = new ArrayList();
        elements.add(data);
        Tuple tuple = new SimpleTuple(elements);
       
        try{
        mOutput.write(tuple);
        }
        catch (PipeClosedException e)
View Full Code Here

    private static class GroupTupleFactory implements TupleFactory
    {

        public Tuple createTuple()
        {
            return new SimpleTuple(
                    Arrays.asList(
                            new Object[] {
                                    mRandom.nextInt(10),
                                    mRandom.nextInt(100)}));
        }
View Full Code Here

    private static class SimpleTupleFactory implements TupleFactory
    {

        public Tuple createTuple()
        {
            return new SimpleTuple(
                    Arrays.asList(
                            new Object[] {
                                    mRandom.nextInt(),
                                    mRandom.nextInt(),
                                    mRandom.nextInt()}));
View Full Code Here

TOP

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

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.