Package cambridge.runtime

Examples of cambridge.runtime.Iter


            iter.next();
        }
    }

    private void iterateDouble(ExpressionContext context, TagNode tag, Writer out, double[] o) throws IOException, TemplateEvaluationException {
        Iter iter = new Iter();
        context.put(getIterObjectName(), iter);
        for (int i=0; i<o.length; i++) {
          if (i == o.length-1)
            iter.setLast();

            context.put(getCurrentObjectName(), o[i]);
            tag.execute(context, out);
            iter.next();
        }
    }
View Full Code Here


            iter.next();
        }
    }

    private void iterateByte(ExpressionContext context, TagNode tag, Writer out, byte[] o) throws IOException, TemplateEvaluationException {
        Iter iter = new Iter();
        context.put(getIterObjectName(), iter);
        for (int i=0; i<o.length; i++) {
          if (i == o.length-1)
            iter.setLast();

            context.put(getCurrentObjectName(), o[i]);
            tag.execute(context, out);
            iter.next();
        }
    }
View Full Code Here

            iter.next();
        }
    }

    private void iterateChar(ExpressionContext context, TagNode tag, Writer out, char[] o) throws IOException, TemplateEvaluationException {
        Iter iter = new Iter();
        context.put(getIterObjectName(), iter);
        for (int i=0; i<o.length; i++) {
          if (i == o.length-1)
            iter.setLast();

            context.put(getCurrentObjectName(), o[i]);
            tag.execute(context, out);
            iter.next();
        }
    }
View Full Code Here

            iter.next();
        }
    }

    private void iterateBoolean(ExpressionContext context, TagNode tag, Writer out, boolean[] o) throws IOException, TemplateEvaluationException {
        Iter iter = new Iter();
        context.put(getIterObjectName(), iter);
        for (int i=0; i<o.length; i++) {
          if (i == o.length-1)
            iter.setLast();

            context.put(getCurrentObjectName(), o[i]);
            tag.execute(context, out);
            iter.next();
        }
    }
View Full Code Here

    }

    @Override
    public void doExecute(ExpressionContext context, TagNode tag, Writer out) throws TemplateEvaluationException, IOException {
        try {
            Iter iter = new Iter();
            while (expression.asBoolean(context)) {
                context.put(Expressions.ITER_OBJECT, iter);
                tag.execute(context, out);
                iter.next();
            }
        } catch (ExpressionEvaluationException e) {
            throw new TemplateEvaluationException(e, "Could not execute the expression: " +
                    e.getMessage() + ", on line: " + tag.getBeginLine() + ", column: " +
                    tag.getBeginColumn(), tag.getBeginLine(), tag.getBeginColumn(), tag.getTagName());
View Full Code Here

    }

    @Override
    public void doExecute(ExpressionContext context, TagNode tag, Writer out) throws TemplateEvaluationException, IOException {
        try {
            Iter iter = new Iter();
            for (int i = from.asInt(context); i <= to.asInt(context); i++) {
              if (i == to.asInt(context))
                iter.setLast();

                context.put(Expressions.CURRENT_OBJECT, i);
                context.put(Expressions.ITER_OBJECT, iter);
                tag.execute(context, out);
                iter.next();
            }
        } catch (ExpressionEvaluationException e) {
            throw new TemplateEvaluationException(e, "Could not execute the expression: " + e.getMessage() +
                    ", on line: " + tag.getBeginLine() + ", column: " + tag.getBeginColumn(),
                    tag.getBeginLine(), tag.getBeginColumn(), tag.getTagName());
View Full Code Here

TOP

Related Classes of cambridge.runtime.Iter

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.