Package com.helger.jcodemodel

Examples of com.helger.jcodemodel.JForLoop


        }

        void appendNotNullValue(AbstractJType type, IJExpression value) {
            if (type.isArray()) {
                VariableNameSource localNames = nameSource.forBlock();
                JForLoop _for = body._for();
                JVar i = _for.init(types._int, localNames.get("i"), JExpr.lit(0));
                _for.test(i.lt(value.ref("length")));
                _for.update(i.incr());
                Body forBody = new Body(result, _for.body(), localNames);
                if (type.elementType().isReference())
                    forBody.appendNullableValue(type.elementType(), value.component(i));
                else
                    forBody.appendNotNullValue(type.elementType(), value.component(i));
            } else if (!type.isPrimitive()) {
View Full Code Here


                JInvocation invocation = types._Math.staticInvoke("min");
                invocation.arg(value1.ref("length"));
                invocation.arg(value2.ref("length"));
                JVar length = body.decl(types._int, nameSource.get("length"), invocation);
                VariableNameSource localNames = nameSource.forBlock();
                JForLoop _for = body._for();
                JVar i = _for.init(types._int, localNames.get("i"), JExpr.lit(0));
                _for.test(i.lt(length));
                _for.update(i.incr());
                Body forBody = new Body(resultVariable, _for.body(), localNames);
                if (type.elementType().isReference())
                    forBody.appendNullableValue(type.elementType(), value1.component(i), value2.component(i));
                else
                    forBody.appendNotNullValue(type.elementType(), value1.component(i), value2.component(i));
                appendNotNullValue(types._int, value1.ref("length"), value2.ref("length"));
View Full Code Here

    void appendNotNullValue(AbstractJType type, IJExpression value1, IJExpression value2) {
        if (type.isArray()) {
            appendNotNullValue(types._int, value1.ref("length"), value2.ref("length"));
            VariableNameSource localNames = nameSource.forBlock();
            JForLoop _for = body._for();
            JVar i = _for.init(types._int, localNames.get("i"), JExpr.lit(0));
            _for.test(i.lt(value1.ref("length")));
            _for.update(i.incr());
            EqualsMethod forBody = new EqualsMethod(types, _for.body(), localNames);
            if (type.elementType().isReference())
                forBody.appendNullableValue(type.elementType(), value1.component(i), value2.component(i));
            else
                forBody.appendNotNullValue(type.elementType(), value1.component(i), value2.component(i));
        } else if (type.isPrimitive()) {
View Full Code Here

TOP

Related Classes of com.helger.jcodemodel.JForLoop

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.