1 package net.sourceforge.phpdt.internal.compiler.ast;
4 * @author Matthieu Casanova
6 public class SwitchStatement extends Statement {
8 public Expression variable;
9 public AbstractCase[] cases;
11 public SwitchStatement(Expression variable,
15 super(sourceStart, sourceEnd);
16 this.variable = variable;
21 * Return the object into String.
22 * @param tab how many tabs (not used here
25 public String toString(int tab) {
26 final StringBuffer buff = new StringBuffer(tabString(tab));
27 buff.append("switch (").append(variable.toStringExpression()).append(") {\n");
28 for (int i = 0; i < cases.length; i++) {
29 AbstractCase cas = cases[i];
30 buff.append(cas.toString(tab +1));
34 return buff.toString();