1 package net.sourceforge.phpdt.internal.compiler.ast;
6 * A Case statement for a Switch.
7 * @author Matthieu Casanova
9 public class Case extends AbstractCase {
11 public 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.
42 * @return the variables from we change value
44 public List getModifiedVariable() {
45 final List list = super.getModifiedVariable();
46 list.addAll(value.getModifiedVariable());
51 * Get the variables used.
52 * @return the variables used
54 public List getUsedVariable() {
55 final List list = super.getUsedVariable();
56 list.addAll(value.getUsedVariable());