ContextHelp now in new module net.sourceforge.phpeclipse.phphelp
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / phpparser / PHPClassDeclaration.java
1 package net.sourceforge.phpeclipse.phpeditor.phpparser;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
7 import org.eclipse.jface.resource.ImageDescriptor;
8 /**
9  * 
10  * @author khartlage
11  */
12 public class PHPClassDeclaration extends PHPSegment {
13   ArrayList fFunctions;
14
15   public PHPClassDeclaration(Object parent, String name, int index) {
16     super(parent, name, index);
17     fFunctions = new ArrayList();
18   }
19
20   public List getList( ) {
21     return fFunctions;
22   }
23   /**
24    * Appends the specified function declaration 
25    *
26    * @param o function declaration to be appended to this list.
27    * @return <tt>true</tt> (as per the general contract of Collection.add).
28    */
29   public boolean add(PHPSegment o) {
30     return fFunctions.add(o);
31   }
32
33   /**
34    * Returns the function declaration at the specified position in this list.
35    *
36    * @param  index index of function declaration to return.
37    * @return the function declaration at the specified position in this list.
38    * @throws    IndexOutOfBoundsException if index is out of range <tt>(index
39    *      &lt; 0 || index &gt;= size())</tt>.
40    */
41   public PHPSegment get(int index) {
42     return (PHPSegment) fFunctions.get(index);
43   }
44
45   /**
46      * Returns the number of declarations in this list.
47      *
48      * @return  the number of declarations in this list.
49      */
50   public int size() {
51     return fFunctions.size();
52   }
53   
54   public ImageDescriptor getImage() {
55     return PHPUiImages.DESC_CLASS;
56   }
57 }