*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / ClassDeclaration.java
index 000afb9..5bdc3c6 100644 (file)
@@ -2,12 +2,14 @@ package net.sourceforge.phpdt.internal.compiler.ast;
 
 import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
 import net.sourceforge.phpdt.internal.compiler.parser.OutlineableWithChildren;
+import net.sourceforge.phpdt.internal.compiler.ast.declarations.VariableUsage;
 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.text.Position;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Enumeration;
 
 
 /**
@@ -39,16 +41,17 @@ public class ClassDeclaration extends Statement implements OutlineableWithChildr
   private ArrayList children = new ArrayList();
 
   private Position position;
+
   /**
    * Create a class giving starting and ending offset
    * @param sourceStart starting offset
    * @param sourceEnd ending offset
    */
-  public ClassDeclaration(Object parent,
-                          char[] name,
-                          char[] superclass,
-                          int sourceStart,
-                          int sourceEnd) {
+  public ClassDeclaration(final Object parent,
+                          final char[] name,
+                          final char[] superclass,
+                          final int sourceStart,
+                          final int sourceEnd) {
     super(sourceStart, sourceEnd);
     this.parent = parent;
     this.name = name;
@@ -61,17 +64,17 @@ public class ClassDeclaration extends Statement implements OutlineableWithChildr
    * @param sourceStart starting offset
    * @param sourceEnd ending offset
    */
-  public ClassDeclaration(Object parent,
-                          char[] name,
-                          int sourceStart,
-                          int sourceEnd) {
+  public ClassDeclaration(final Object parent,
+                          final char[] name,
+                          final int sourceStart,
+                          final int sourceEnd) {
     super(sourceStart, sourceEnd);
     this.parent = parent;
     this.name = name;
     position = new Position(sourceStart, name.length);
   }
 
-  public void addMethod(MethodDeclaration method) {
+  public void addMethod(final MethodDeclaration method) {
     methods.add(method);
     add(method);
     if (method.name.equals(name)) {
@@ -79,15 +82,15 @@ public class ClassDeclaration extends Statement implements OutlineableWithChildr
     }
   }
 
-  public void addField(FieldDeclaration var) {
+  public void addField(final FieldDeclaration var) {
     for (int i = 0; i < var.vars.length; i++) {
-      VariableDeclaration c = var.vars[i];
+      final VariableDeclaration c = var.vars[i];
       children.add(c);
     }
     fields.add(var);
   }
 
-  public boolean add(Outlineable o) {
+  public boolean add(final Outlineable o) {
     return children.add(o);
   }
 
@@ -104,7 +107,7 @@ public class ClassDeclaration extends Statement implements OutlineableWithChildr
    * @param tab how many tabs before the class
    * @return the code of this class into String
    */
-  public String toString(int tab) {
+  public String toString(final int tab) {
     return tabString(tab) + toStringHeader() + toStringBody(tab);
   }
 
@@ -113,18 +116,18 @@ public class ClassDeclaration extends Statement implements OutlineableWithChildr
    * @param tab how many tabs before the body of the class
    * @return the body as String
    */
-  public String toStringBody(int tab) {
+  public String toStringBody(final int tab) {
     final StringBuffer buff = new StringBuffer(" {");//$NON-NLS-1$
     if (fields != null) {
       for (int i = 0; i < fields.size(); i++) {
-        FieldDeclaration field = (FieldDeclaration) fields.get(i);
+        final FieldDeclaration field = (FieldDeclaration) fields.get(i);
         buff.append("\n"); //$NON-NLS-1$
         buff.append(field.toString(tab + 1));
         buff.append(";");//$NON-NLS-1$
       }
     }
     for (int i = 0; i < methods.size(); i++) {
-      MethodDeclaration o = (MethodDeclaration) methods.get(i);
+      final MethodDeclaration o = (MethodDeclaration) methods.get(i);
       buff.append("\n");//$NON-NLS-1$
       buff.append(o.toString(tab + 1));
     }
@@ -157,7 +160,7 @@ public class ClassDeclaration extends Statement implements OutlineableWithChildr
     return parent;
   }
 
-  public Outlineable get(int index) {
+  public Outlineable get(final int index) {
     return (Outlineable) children.get(index);
   }
 
@@ -181,4 +184,28 @@ public class ClassDeclaration extends Statement implements OutlineableWithChildr
   public List getList() {
     return children;
   }
+
+  /**
+   * Get the variables from outside (parameters, globals ...)
+   * @return the variables from outside
+   */
+  public List getOutsideVariable() {
+    return new ArrayList();
+  }
+
+  /**
+   * get the modified variables.
+   * @return the variables from we change value
+   */
+  public List getModifiedVariable() {
+    return new ArrayList();
+  }
+
+  /**
+   * Get the variables used.
+   * @return the variables used
+   */
+  public List getUsedVariable() {
+    return new ArrayList();
+  }
 }