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
- * < 0 || index >= 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;
}