Examples of JForLoop


Examples of com.sun.codemodel.JForLoop

    /**
     * Write out a loop which will read in a sequence of elements.
     *
     */
    private void writeAttributeReader(JBlock b) {
        JForLoop loop = b._for();
        JVar var = loop.init(model._ref(int.class), "i", JExpr.lit(0));
        loop.test(var.lt(xsrVar.invoke("getAttributeCount")));
        loop.update(var.assignPlus(JExpr.lit(1)));
       
        b = loop.body();
        JVar attName = b.decl(model._ref(String.class), "attName", xsrVar.invoke("getAttributeLocalName").arg(var));
        JVar attNs = b.decl(model._ref(String.class), "attNs", xsrVar.invoke("getAttributeNamespace").arg(var));
        JVar attValue = b.decl(model._ref(String.class), "attValue", xsrVar.invoke("getAttributeValue").arg(var));
       
        JConditional cond = null;
View Full Code Here

Examples of com.sun.codemodel.JForLoop

            setupBlock.assign(workspaceJVars[i], JExpr._new(g.getHolderType(workspaceVars[i].majorType)));
          }
        }

        //Use for loop to initialize entries in the workspace vectors.
        JForLoop forLoop = setupBlock._for();
        JVar ivar = forLoop.init(g.getModel().INT, "drill_internal_i", JExpr.lit(0));
        forLoop.test(ivar.lt(sizeVar));
        forLoop.update(ivar.assignPlus(JExpr.lit(1)));

        JBlock subBlock = generateInitWorkspaceBlockHA(g, BlockType.SETUP, setup, workspaceJVars, ivar);
        forLoop.body().add(subBlock);
        return workspaceJVars;
      }


  }
View Full Code Here

Examples of com.sun.codemodel.JForLoop

                (JAssignmentTarget) acc.ref(true),
                castToImplTypeArray(JExpr.newArray(
                    codeModel.ref(exposedType.erasure().fullName()),
                    $len)));

        JForLoop _for = $setAll.body()._for();
        JVar $i = _for.init( codeModel.INT, "i", JExpr.lit(0) );
        _for.test( JOp.lt($i,$len) );
        _for.update( $i.incr() );
        _for.body().assign(acc.ref(true).component($i), castToImplType(acc.box($value.component($i))));

        writer.javadoc().addParam($value)
            .append("allowed objects are\n")
            .append(returnTypes);
View Full Code Here

Examples of com.sun.codemodel.internal.JForLoop

                (JAssignmentTarget) acc.ref(true),
                castToImplTypeArray(JExpr.newArray(
                    codeModel.ref(exposedType.erasure().fullName()),
                    $len)));

        JForLoop _for = $setAll.body()._for();
        JVar $i = _for.init( codeModel.INT, "i", JExpr.lit(0) );
        _for.test( JOp.lt($i,$len) );
        _for.update( $i.incr() );
        _for.body().assign(acc.ref(true).component($i), castToImplType(acc.box($value.component($i))));

        writer.javadoc().addParam($value)
            .append("allowed objects are\n")
            .append(returnTypes);
View Full Code Here

Examples of com.sun.codemodel.internal.JForLoop

                (JAssignmentTarget) acc.ref(true),
                castToImplTypeArray(JExpr.newArray(
                    codeModel.ref(exposedType.erasure().fullName()),
                    $len)));

        JForLoop _for = $setAll.body()._for();
        JVar $i = _for.init( codeModel.INT, "i", JExpr.lit(0) );
        _for.test( JOp.lt($i,$len) );
        _for.update( $i.incr() );
        _for.body().assign(acc.ref(true).component($i), castToImplType(acc.box($value.component($i))));

        writer.javadoc().addParam($value)
            .append("allowed objects are\n")
            .append(returnTypes);
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.