Newer
Older
AlgebraicDataflowArchitectureModel / AlgebraicDataflowArchitectureModel / src / code / ast / EnhancedForStatement.java
package code.ast;

public class EnhancedForStatement extends Statement {

    private VariableDeclaration singleVariableDeclaration;
    private Expression expression;
    private Statement body;

    public VariableDeclaration getParameter() { return singleVariableDeclaration; }
    public void setParameter(VariableDeclaration parameter) { this.singleVariableDeclaration = parameter; }

    public Expression getExpression() { return expression; }
    public void setExpression(Expression expression) { this.expression = expression; }

    public Statement getBody() { return body; }
    public void setBody(Statement body) { this.body = body; }

    @Override
    public String toString() {
        String typeName = singleVariableDeclaration.getType().getImplementationTypeName();
        return "for (" + typeName + " " + singleVariableDeclaration.getName() + " : " + expression + ") " + body;
    }
}