1 package net.sourceforge.phpdt.internal.compiler.ast;
6 * A Case statement for a Switch.
7 * @author Matthieu Casanova
9 public final class Case extends AbstractCase {
11 private final Expression value;
13 public Case(final Expression value,
14 final Statement[] statements,
15 final int sourceStart,
16 final int sourceEnd) {
17 super(statements, sourceStart, sourceEnd);
22 * Return the object into String.
23 * @param tab how many tabs (not used here
26 public String toString(final int tab) {
27 final StringBuffer buff = new StringBuffer(tabString(tab));
29 buff.append(value.toStringExpression());
31 if (statements != null) {
32 for (int i = 0; i < statements.length; i++) {
33 final Statement statement = statements[i];
34 buff.append(statement.toString(tab + 1));
37 return buff.toString();
41 * get the modified variables.
43 * @param list the list where we will put variables
45 public void getModifiedVariable(final List list) {
46 super.getModifiedVariable(list);
47 value.getModifiedVariable(list);
51 * Get the variables used.
53 * @param list the list where we will put variables
55 public void getUsedVariable(final List list) {
56 super.getUsedVariable(list);
57 value.getUsedVariable(list);