1 16 package com.google.gwt.dev.generator.ast; 17 18 import java.util.List ; 19 20 23 public class WhileLoop implements Statements { 24 25 private final StatementsList body = new StatementsList(); 26 27 private final String test; 28 29 36 public WhileLoop(String test) { 37 this.test = test; 38 } 39 40 public List getStatements() { 41 return body.getStatements(); 42 } 43 44 public String toCode() { 45 return "while ( " + test + " ) {\n" + 46 body.toCode() + "\n" + 47 "}\n"; 48 } 49 } 50 | Popular Tags |