From 9778094f891bdc82436360da0a75896fb8fb81b8 Mon Sep 17 00:00:00 2001
From: kpouer <kpouer>
Date: Sat, 25 Jan 2003 15:51:24 +0000
Subject: [PATCH 1/1] we now extend PHPSegmentWithChildren

---
 .../phpeditor/phpparser/PHPClassDeclaration.java   |   49 ++++----------------
 1 files changed, 10 insertions(+), 39 deletions(-)

diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPClassDeclaration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPClassDeclaration.java
index 2f13dfb..eb7b3cc 100644
--- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPClassDeclaration.java
+++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPClassDeclaration.java
@@ -1,56 +1,27 @@
 package net.sourceforge.phpeclipse.phpeditor.phpparser;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
 import org.eclipse.jface.resource.ImageDescriptor;
 /**
- * 
+ * A class declaration.
  * @author khartlage
  */
-public class PHPClassDeclaration extends PHPSegment {
-  ArrayList fFunctions;
-
-  public PHPClassDeclaration(Object parent, String name, int index) {
-    super(parent, name, index);
-    fFunctions = new ArrayList();
-  }
+public class PHPClassDeclaration extends PHPSegmentWithChildren {
 
-  public List getList( ) {
-    return fFunctions;
-  }
   /**
-   * Appends the specified function declaration 
-   *
-   * @param o function declaration to be appended to this list.
-   * @return <tt>true</tt> (as per the general contract of Collection.add).
+   * Create a class declaration.
+   * @param parent the parent object (it should be a php class)
+   * @param name the name of the class
+   * @param index where the class is in the file
    */
-  public boolean add(PHPSegment o) {
-    return fFunctions.add(o);
+  public PHPClassDeclaration(Object parent, String name, int index) {
+    super(parent, name, index);
   }
 
   /**
-   * Returns the function declaration at the specified position in this list.
-   *
-   * @param  index index of function declaration to return.
-   * @return the function declaration at the specified position in this list.
-   * @throws    IndexOutOfBoundsException if index is out of range <tt>(index
-   *      &lt; 0 || index &gt;= size())</tt>.
+   * Get the image of a class.
+   * @return the image that represents a php class
    */
-  public PHPSegment get(int index) {
-    return (PHPSegment) fFunctions.get(index);
-  }
-
-  /**
-     * Returns the number of declarations in this list.
-     *
-     * @return  the number of declarations in this list.
-     */
-  public int size() {
-    return fFunctions.size();
-  }
-  
   public ImageDescriptor getImage() {
     return PHPUiImages.DESC_CLASS;
   }
-- 
1.7.1