Examples of Tuple


Examples of org.hibernate.ogm.model.spi.Tuple

  private List<Object> getAssociationRows(Association association, AssociationKey associationKey) {
    List<Object> rows = new ArrayList<Object>();

    for ( RowKey rowKey : association.getKeys() ) {
      Tuple tuple = association.get( rowKey );

      String[] columnsToPersist = associationKey.getMetadata().getColumnsWithoutKeyColumns( tuple.getColumnNames() );

      // return value itself if there is only a single column to store
      if ( columnsToPersist.length == 1 ) {
        Object row = tuple.get( columnsToPersist[0] );
        rows.add( row );
      }
      else {
        Map<String, Object> row = new HashMap<String, Object>( columnsToPersist.length );
        for ( String columnName : columnsToPersist ) {
          row.put( columnName, tuple.get( columnName ) );
        }

        rows.add( row );
      }
    }
View Full Code Here

Examples of org.jboss.bpm.monitor.model.bpaf.Tuple

              ProcessInstanceEvent instanceEvent = (ProcessInstanceEvent) source;
              target.setProcessInstanceID(instanceEvent.getProcessInstanceId().toString());
            }
          
           //put the data as a property.
           Tuple data = new Tuple();
           data.setName("data");
           data.setValue(getProcessEventAsString(source));
          
           target.addData(data);
          
            // can return null and thus invalidate the event
            target = mapping.adoptDetails(target, source);
View Full Code Here

Examples of org.jrdf.query.relation.Tuple

    private EvaluatedRelation project(EvaluatedRelation relation, Set<Attribute> newHeading) {
        Set<Tuple> newTuples = new HashSet<Tuple>();
        Set<Tuple> tuples = relation.getTuples();
        for (Tuple tuple : tuples) {
            Tuple newTuple = createNewTuples(tuple, newHeading);
            // TODO (AN) Only add non empty attributes - this failed.
            if (!newTuple.getAttributeValues().isEmpty()) {
                newTuples.add(newTuple);
            }
        }

        // TODO (AN) Used to just be getRelation(newHeading) - this failed.
View Full Code Here

Examples of org.jruby.compiler.ir.Tuple

                throw new RuntimeException("Encountered " + yieldSites.size() + " yield sites.  Convert the yield to a call by converting the closure into a dummy method (have to convert all frame vars to call arguments, or at least convert the frame into a call arg");

            if (!(closureArg instanceof MetaObject))
                throw new RuntimeException("Encountered a dynamic closure arg.  Cannot inline it here!  Convert the yield to a call by converting the closure into a dummy method (have to convert all frame vars to call arguments, or at least convert the frame into a call arg");

            Tuple t = (Tuple)yieldSites.get(0);
            inlineClosureAtYieldSite(ii, (IRClosure)((MetaObject)closureArg).scope, (BasicBlock)t.a, (YieldInstr)t.b);
        }

        // Update the bb array
        setupFallThruMap();
View Full Code Here

Examples of org.jruby.ir.Tuple

            if (!(closureArg instanceof WrappedIRClosure)) {
                throw new RuntimeException("Encountered a dynamic closure arg.  Cannot inline it here!  Convert the yield to a call by converting the closure into a dummy method (have to convert all frame vars to call arguments, or at least convert the frame into a call arg");
            }

            Tuple t = (Tuple) yieldSites.get(0);
            inlineClosureAtYieldSite(ii, ((WrappedIRClosure) closureArg).getClosure(), (BasicBlock) t.a, (YieldInstr) t.b);
        }

        // 9. Optimize cfg by merging straight-line bbs
        cfg.collapseStraightLineBBs();
View Full Code Here

Examples of org.latte.util.Tuple

    public void render(final StringBuilder buffer, Context cx, Scriptable scope, Object params) throws Exception {
      script.eval(
        cx,
        scope,
        new Tuple[] {
          new Tuple("params", params),
          new Tuple("echo", new Callable() {
            public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] params) {
              try {
                if(params != null && params.length == 1) buffer.append(params[0].toString());
                else throw new IllegalArgumentException("expecting 1 arg");
             
View Full Code Here

Examples of org.molgenis.util.tuple.Tuple

  {
    TupleTable tupleTable = mock(TupleTable.class);
    Field field1 = when(mock(Field.class).getSqlName()).thenReturn("col1").getMock();
    Field field2 = when(mock(Field.class).getSqlName()).thenReturn("col2").getMock();
    when(tupleTable.getColumns()).thenReturn(Arrays.asList(field1, field2));
    Tuple row1 = mock(Tuple.class);
    when(row1.getNrCols()).thenReturn(2);
    when(row1.get("col1")).thenReturn("val1");
    when(row1.get("col2")).thenReturn("val2");
    when(row1.hasColNames()).thenReturn(true);
    when(row1.getColNames()).thenReturn(Arrays.asList("col1", "col2"));

    Tuple row2 = mock(Tuple.class);
    when(row2.getNrCols()).thenReturn(2);
    when(row2.get("col1")).thenReturn("val3");
    when(row2.get("col2")).thenReturn("val4");
    when(row2.hasColNames()).thenReturn(true);
    when(row2.getColNames()).thenReturn(Arrays.asList("col1", "col2"));
    when(tupleTable.iterator()).thenReturn(Arrays.asList(row1, row2).iterator());

    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    CsvExporter csvExporter = new CsvExporter(tupleTable);
    csvExporter.export(bos);
View Full Code Here

Examples of org.openfaces.component.chart.Tuple

            return;
        }

        Series firstSeries = nonEmptySeriesList.get(0);
        Tuple[] tuples = firstSeries.getTuples();
        Tuple firstTuple = tuples[0];

        Object key = firstTuple.getKey();
        if (key instanceof Number) {
            modelType = ModelType.Number;
        } else if (key instanceof Date) {
            modelType = ModelType.Date;
        } else if (key instanceof Calendar) {
View Full Code Here

Examples of org.python.antlr.ast.Tuple

                    extslice = true;
                    break;
                }
            }
            if (!extslice) {
                expr t = new Tuple(begin, etypes, expr_contextType.Load);
                s = new Index(begin, t);
            }
        } else if (sltypes.size() == 1) {
            s = castSlice(sltypes.get(0));
        } else if (sltypes.size() != 0) {
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.Tuple

        exprType returnValue = null;
        if (returnList.size() == 1) {
            returnValue = returnList.get(0);

        } else if (returnList.size() > 1) {
            returnValue = new Tuple(returnList.toArray(new exprType[0]), Tuple.Load, false);

        } else if (body.size() == 1) {
            // return expression as-is (note: body must be cleared)
            if (body.get(0) instanceof Expr) {
                Expr expression = (Expr) body.get(0);
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.