Package uk.org.ogsadai.tuple

Examples of uk.org.ogsadai.tuple.Tuple


        TupleMetadata meta = (TupleMetadata) ((MetadataWrapper) blocks.get(1)).getMetadata();
       
        assertEquals("column name is different", name, meta.getColumnMetadata(0).getName());
        assertEquals("column type is different", type, meta.getColumnMetadata(0).getType());
       
       Tuple tuple = (Tuple) blocks.get(3);
       assertEquals("data1 is different", data1, tuple.getInt(0));
    }
View Full Code Here


        TupleMetadata meta = (TupleMetadata) ((MetadataWrapper) blocks.get(1)).getMetadata();
       
        assertEquals("column name is different", name, meta.getColumnMetadata(0).getName());
        assertEquals("column type is different", type, meta.getColumnMetadata(0).getType());
       
       Tuple tuple = (Tuple) blocks.get(3);
       assertEquals("data1 is different", data1, tuple.getObject(0));

    }
View Full Code Here

          new SimpleTupleMetadata(Collections.singletonList(columnMetadata));
        MetadataWrapper metadataWrapper = new MetadataWrapper(tupleMetadata);
   
        List elements = new ArrayList();
        elements.add(data);
        Tuple tuple = new SimpleTuple(elements);
       
       
        String resultColumnName = "expected";
        Classifier classifier = new Classifier();
        classifier.addClassType(0);
View Full Code Here

        try
        {
            //mOutput.write(ControlBlock.LIST_BEGIN);

            Tuple tuple;
            while ((tuple = (Tuple)tuples.nextValue()) != null)
            {
                int posn = 0;

//                if (!filled)
View Full Code Here

           temp = new Vector();
    //       String iterResult = new String("{("+keyIter.next().toString()+")}");
           String iterResult = new String(keyIter.next().toString());
           temp.add(iterResult);
           temp.add(support);
           Tuple dtSupport = new SimpleTuple(temp);
           return dtSupport;
         }
        else
        {
          keyIter.next();
View Full Code Here

         

         
          try
          {
            Tuple tuple;
            Associator associator = (Associator)Class.forName(algorithmClass).newInstance();
            associator.getOptions().setViaCLIString(options);
            Calendar cal = Calendar.getInstance();
            this.startTime = cal.getTimeInMillis();
View Full Code Here

            MetadataWrapper wrapper = new MetadataWrapper(metadata);
           
            mOutput.write(ControlBlock.LIST_BEGIN);
            mOutput.write(wrapper);

            Tuple tuple;
            while ((tuple = Next()) != null)
            {
                mOutput.write(tuple);
           
            mOutput.write(ControlBlock.LIST_END);
View Full Code Here

            TupleJoin join = inv.getInterface(TupleJoin.class);
            TupleMetadata outputMetadata =
                join.getMetadata(
                        (TupleMetadata)tuples1.getMetadataWrapper().getMetadata(),
                        (TupleMetadata)tuples2.getMetadataWrapper().getMetadata());
            Tuple tuple;
            // Store data1 input stream
            List<Tuple> data1 = new LinkedList<Tuple>();
            while ((tuple = (Tuple)tuples1.nextValue()) != null)
            {
                data1.add(tuple);
            }
            mOutput.write(ControlBlock.LIST_BEGIN);
            mOutput.write(outputMetadata);
            Tuple tuple2;
            while ((tuple2 = (Tuple)tuples2.nextValue()) != null)
            {
                for (Tuple tuple1 : data1)
                {
                    List<Tuple> result = join.process(tuple1, tuple2);
View Full Code Here

                      resNest.add(((Tuple)tmpGroup.get(i)).getObject(1));
                  }//edn of for
              res.add(resNest);
                  tmpGroup = new LinkedList();
              tmpGroup.add(lastIn);
                  Tuple dt = new SimpleTuple(res);
                  return dt;
            }//end of else
            lastIn = (Tuple)inputOp.nextValue();
        }//end of if
      }//end of if
   
      if(atEOF && tmpGroup!=null)
      {
             Vector res = new Vector();
        //grouping field
             res.add(((Tuple)tmpGroup.get(0)).getObject(0));
             Vector resNest = new Vector();
            
        for(int i=0;i<tmpGroup.size();i++)
        {
              resNest.add(((Tuple)tmpGroup.get(i)).getObject(1));
             }//end of for
        res.add(resNest);
             tmpGroup = null;
             Tuple dt = new SimpleTuple(res);
             return dt;
      }//end of if
      return null;
    }
View Full Code Here

    protected void processIteration(Object[] iterationData)
        throws ActivityProcessingException, ActivityTerminatedException,
        ActivityUserException
    {
        TupleListIterator tuples = (TupleListIterator)iterationData[0];
        Tuple tuple;
        try
        {
            mOutput.write(ControlBlock.LIST_BEGIN);
            List columns = new ArrayList();
            ColumnMetadata col0 = new SimpleColumnMetadata("groupID", TupleTypes._STRING, 0, 0, 0);
View Full Code Here

TOP

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

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.