1 package net.sourceforge.phpdt.internal.compiler.ast;
4 import java.util.ArrayList;
7 * Superclass of case statement that we can find in a switch.
8 * @author Matthieu Casanova
10 public abstract class AbstractCase extends Statement {
12 /** The statements in the case. */
13 public Statement[] statements;
16 * Create a case statement
17 * @param statements the statements array
18 * @param sourceStart the beginning source offset
19 * @param sourceEnd the ending offset
21 public AbstractCase(final Statement[] statements,
22 final int sourceStart,
23 final int sourceEnd) {
24 super(sourceStart, sourceEnd);
25 this.statements = statements;
30 * Get the variables from outside (parameters, globals ...)
31 * @return the variables from outside
33 public List getOutsideVariable() {
34 final ArrayList list = new ArrayList();
35 for (int i = 0; i < statements.length; i++) {
36 list.addAll(statements[i].getOutsideVariable());
42 * get the modified variables.
43 * @return the variables from we change value
45 public List getModifiedVariable() {
46 final ArrayList list = new ArrayList();
47 for (int i = 0; i < statements.length; i++) {
48 list.addAll(statements[i].getModifiedVariable());
54 * Get the variables used.
55 * @return the variables used
57 public List getUsedVariable() {
58 final ArrayList list = new ArrayList();
59 for (int i = 0; i < statements.length; i++) {
60 list.addAll(statements[i].getUsedVariable());