1 46 package org.codehaus.groovy.ast.stmt; 47 48 import org.codehaus.groovy.ast.GroovyCodeVisitor; 49 import org.codehaus.groovy.ast.Type; 50 import org.codehaus.groovy.ast.expr.Expression; 51 52 58 public class ForStatement extends Statement { 59 60 private String variable; 61 private Expression collectionExpression; 62 private Statement loopBlock; 63 private Type variableType; 64 65 66 public ForStatement(String variable, Type variableType, Expression collectionExpression, Statement loopBlock) { 67 this.variable = variable; 68 this.variableType = variableType; 69 this.collectionExpression = collectionExpression; 70 this.loopBlock = loopBlock; 71 } 72 73 public void visit(GroovyCodeVisitor visitor) { 74 visitor.visitForLoop(this); 75 } 76 77 public Expression getCollectionExpression() { 78 return collectionExpression; 79 } 80 81 public Statement getLoopBlock() { 82 return loopBlock; 83 } 84 85 public String getVariable() { 86 return variable; 87 } 88 89 public Type getVariableType() { 90 return variableType; 91 } 92 93 public void setVariableType(Type varType) { 94 variableType = varType; 95 } 96 } 97 | Popular Tags |