*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / Case.java
index a66d3f1..1428b25 100644 (file)
@@ -1,5 +1,7 @@
 package net.sourceforge.phpdt.internal.compiler.ast;
 
+import java.util.List;
+
 /**
  * A Case statement for a Switch.
  * @author Matthieu Casanova
@@ -7,12 +9,11 @@ package net.sourceforge.phpdt.internal.compiler.ast;
 public class Case extends AbstractCase {
 
   public Expression value;
-  public Statement[] statements;
 
-  public Case(Expression value,
-              Statement[] statements,
-              int sourceStart,
-              int sourceEnd) {
+  public Case(final Expression value,
+              final Statement[] statements,
+              final int sourceStart,
+              final int sourceEnd) {
     super(statements, sourceStart, sourceEnd);
     this.value = value;
   }
@@ -22,17 +23,37 @@ public class Case extends AbstractCase {
    * @param tab how many tabs (not used here
    * @return a String
    */
-  public String toString(int tab) {
+  public String toString(final int tab) {
     final StringBuffer buff = new StringBuffer(tabString(tab));
     buff.append("case ");
     buff.append(value.toStringExpression());
     buff.append(" :\n");
     if (statements != null) {
       for (int i = 0; i < statements.length; i++) {
-        Statement statement = statements[i];
+        final Statement statement = statements[i];
         buff.append(statement.toString(tab + 1));
       }
     }
     return buff.toString();
   }
+
+  /**
+   * get the modified variables.
+   * @return the variables from we change value
+   */
+  public List getModifiedVariable() {
+    final List list = super.getModifiedVariable();
+    list.addAll(value.getModifiedVariable());
+    return list;
+  }
+
+  /**
+   * Get the variables used.
+   * @return the variables used
+   */
+  public List getUsedVariable() {
+    final List list = super.getUsedVariable();
+    list.addAll(value.getUsedVariable());
+    return list;
+  }
 }